Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ABSPOSO

ABSPOSO.m

Go to the documentation of this file.
  1. ABSPOSO ; IHS/FCS/DRS - "O" is for Override NCPDP field values ; [ 08/20/2002 8:46 AM ]
  1. ;;1.0;PHARMACY POINT OF SALE;**3,6,23**;JUN 21, 2001;Build 38
  1. ;
  1. ; File 9002313.511 ABSP NCPDP OVERRIDE
  1. ; It acts like an extension of the ^PSRX entry,
  1. ; though it's not tied to ^PSRX in any structural way.
  1. ; ^PSRX has a pointer to this file.
  1. ;
  1. ; IHS/SD/lwj 8/20/02 NCPDP 5.1 changes
  1. ; In 5.1 there is now some repeating fields/records. The DUR/PPS
  1. ; segment is a repeating segment (i.e. all the fields in this
  1. ; segment repeat.) Much like the values for the ABSP NCPDP
  1. ; Overrides are stored in a separate file, and referenced in
  1. ; the prescription file, the DUR/PPS values will be stored in
  1. ; a separate file (ABSP DUR/PPS) and simply referenced in the
  1. ; prescription file. For this reason, I'm adding the retrieval
  1. ; of the prescription DUR/PPS pointer in this routine to keep
  1. ; things consistent. (Site must have Outpatient Pharmacy V6.0
  1. ; Patch 4 loaded for the DUR/PPS field to be found.)
  1. ;
  1. ;---
  1. ;IHS/SD/lwj 6/19/03 Patch 6 - DUR segment for NCPDP 5.1
  1. ; We need to allow the pharmacist to override the DUR
  1. ; values as they exist in the 5.1 segment. New subroutine
  1. ; created to allow for both the incoming IEN value for the
  1. ; regular overrides, and the DIEN for the DUR segment
  1. ; overrides. (Subroutine will look much like OVERRIDE
  1. ; with the exception of the new parameters - new routine
  1. ; created to avoid conflict with existing code.)
  1. ;---
  1. ;IHS/SD/RLT - 06/21/07 - 10/18/07 - Patch 23
  1. ; Added new tag GETDIAG.
  1. Q
  1. ;
  1. OVERRIDE(IEN) ; main entry point
  1. ; IEN points to file 9002313.511
  1. ; Sometimes we have IEN; sometimes we don't
  1. ; called from pharmacy package
  1. ; called from somewhere in POS, too
  1. I $D(IEN) D
  1. . I '$D(^ABSP(9002313.511,IEN)) D ; it must have been winnowed
  1. . . S IEN=$$NEW^ABSPOSO2
  1. E D
  1. . I '$D(IEN) S IEN=$$NEW^ABSPOSO2
  1. I 'IEN D IMPOSS^ABSPOSUE("FM,P","TI","Failed to create Overrides record / or bad parameter in call",,"OVERRIDE",$T(+0)) Q:$Q "" Q
  1. D MENU^ABSPOSO1(IEN)
  1. Q:$Q IEN Q
  1. OVERRIDR(RXI,RXR) ; alternative entry point - given RXI,RXR instead of IEN
  1. N IEN
  1. I $G(RXR) S IEN=$$GETIEN(RXI,RXR)
  1. E S IEN=$$GETIEN(RXI)
  1. S IEN=$$OVERRIDE(IEN)
  1. Q:$Q IEN Q
  1. GETIEN(RXI,RXR) ;EP - also called from claim construction
  1. N IEN
  1. I $G(RXR) S IEN=$P($G(^PSRX(RXI,1,RXR,9999999)),U,12)
  1. E S IEN=$P($G(^PSRX(RXI,9999999)),U,12)
  1. Q IEN
  1. ;
  1. ;
  1. GETDUR(RXI,RXR) ;EP - also called from claim construction
  1. ;IHS/SD/lwj 8/20/02 NCPDP 5.1 changes - retrieve DUR/PPS pointer
  1. ; from the prescription file
  1. N IEN
  1. I $G(RXR) S IEN=$P($G(^PSRX(RXI,1,RXR,9999999)),U,13)
  1. E S IEN=$P($G(^PSRX(RXI,9999999)),U,13)
  1. Q IEN
  1. ;
  1. GETDIAG(RXI,RXR) ;EP - called from ABSPOSII and ABSPOSQB
  1. ;Get DIAGNOSIS CODE POINTER from prescription file
  1. N IEN
  1. ;I $G(RXR) S IEN=$P($G(^PSRX(RXI,1,RXR,9999999)),U,17)
  1. ;E S IEN=$P($G(^PSRX(RXI,9999999)),U,17)
  1. ;POINTERS REMOVED FROM PRESCRIPTION FILE
  1. S IEN=0
  1. S IEN=$O(^ABSP(9002313.491,"AC",RXI,IEN))
  1. Q IEN
  1. ;
  1. NEWOVER(IEN,DURIEN) ;EP IHS/SD/lwj 6/19/03 patch 6
  1. ; This routine was copied from OVERRIDE. It was
  1. ; adjusted to allow for entry of the usual overrides,
  1. ; plus the 5.1 DUR segment values.
  1. ;
  1. ; IEN points to file 9002313.511
  1. ; DURIEN points to file ^ABSP(9002313.473 DUR/PPS
  1. ; (We only have the EN when this is an edit to
  1. ; existing entries.)
  1. ;
  1. ;
  1. N DIEN,CIEN,RIEN
  1. S DIEN=$G(DURIEN)
  1. ;
  1. I $G(IEN) D
  1. . I '$D(^ABSP(9002313.511,IEN)) D ; it must have been winnowed
  1. . . S IEN=$$NEW^ABSPOSO2
  1. ;
  1. S:'$G(IEN) IEN=$$NEW^ABSPOSO2
  1. I 'IEN D IMPOSS^ABSPOSUE("FM,P","TI","Failed to create Overrides record / or bad parameter in call",,"OVERRIDE",$T(+0)) Q:$Q "" Q
  1. ;
  1. ; Now create the DIEN - the difference between this and the IEN is that
  1. ; if they don't add anything in for the DIEN, we delete the whole record
  1. ;
  1. I $G(DIEN) D
  1. . I '$D(^ABSP(9002313.473,DIEN)) D ;must be there
  1. . . S DIEN=$$NEW^ABSPOSD2
  1. ;
  1. S:'$G(DIEN) DIEN=$$NEW^ABSPOSD2
  1. ;
  1. I 'DIEN D IMPOSS^ABSPOSUE("FM,P","TI","Failed to create DUR rec",,"OVERRIDE",$T(+0)) Q:$Q "" Q
  1. ;
  1. ; call the menu for the user
  1. ;
  1. S RIEN=IEN
  1. S:$G(DIEN)'="" RIEN=RIEN_"^"_$G(DIEN)
  1. ;
  1. D MENU^ABSPOSO1(RIEN)
  1. ;
  1. ;Last step - we need to verify we have values - otherwise
  1. ; let's get rid of the DUR record so it's not cluttering
  1. ; up the place
  1. ;
  1. S DIEN=$$CHKDUR^ABSPOSD2(DIEN)
  1. ;
  1. S RIEN=IEN
  1. S:$G(DIEN)'="" RIEN=RIEN_"^"_$G(DIEN)
  1. ;
  1. Q:$Q RIEN Q