- ABSPOSCB ; IHS/FCS/DRS - VMEDS(*) prep for ABSP(*) ; [ 09/12/2002 10:07 AM ]
- ;;1.0;PHARMACY POINT OF SALE;**3**;JUN 21, 2001;Build 38
- ;----------------------------------------------------------------------
- ;----------------------------------------------------------------------
- ; Called from ABSPOSCA from ABSPOSQG from ABSPOSQ2
- ;Setup ABSP() array which contains all pertinent data to create
- ;Claim Submission Records for the current Billing Item Record:
- ;
- ;Parameters: DIALOUT - Dial-out (9002313.55)
- ; .ABSP - Formatted array containing data required
- ; to create claim submission records
- ;----------------------------------------------------------------------
- ;
- Q
- ABSP(DIALOUT,ABSP) ;EP
- I $D(RXILIST)<10 D IMPOSS^ABSPOSUE("P","TI","bad RXILIST",,,$T(+0))
- N PATIEN,VMEDS,NMEDS,INSURER,INSPINS,VSTIEN,INDEX
- D ; set up some vars and make very sure some basic data exists
- . N RXI,R0,R1 S RXI=$O(RXILIST(""))
- . S R0=^ABSPT(RXI,0),R1=^(1)
- . S PATIEN=$P(R0,U,6)
- . S VSTIEN=$P(R0,U,7)
- . S INSURER=$P(R1,U,6)
- . S INSPINS=$P(R1,U,8),INSPINS=$P(^ABSPT(RXI,6),U,INSPINS)
- . I 'PATIEN D IMPOSS^ABSPOSUE("DB","TI","PATIEN",,,$T(+0))
- . I '$D(^DPT(PATIEN,0)) D IMPOSS^ABSPOSUE("DB","TI","^DPT(PATIEN)",,,$T(+0))
- . I 'VSTIEN D IMPOSS^ABSPOSUE("DB","TI","VSTIEN",,,$T(+0))
- . I '$D(^AUPNVSIT(VSTIEN,0)) D IMPOSS^ABSPOSUE("DB","TI","^AUPNVSIT(VSITIEN,0)",,,$T(+0))
- ;
- E ;Set up VMEDS(*)=a bunch of pointers to important stuff
- ; Somewhat vestigial but for now, it survives.
- D GETVMED(.VMEDS)
- I '$D(VMEDS) Q 551
- I 'VMEDS(0) Q 553
- ;
- ;Get general info and set up ABSP array for Patient, Insurer, Site and
- ;NCPDP record format data
- D GETINFO^ABSPOSCC(DIALOUT,PATIEN,VSTIEN,INSPINS,INSURER)
- ;
- ;Determine number of mediations returned from GetInfo procedure
- S NMEDS=+$G(VMEDS(0))
- S ABSP("RX",0)=NMEDS
- Q:NMEDS=0 552
- L ;Get medication and prescription data for each medication
- F INDEX=1:1:NMEDS D MEDINFO^ABSPOSCD(VMEDS(INDEX),INDEX,INSPINS)
- Q 0
- ;----------------------------------------------------------------------
- ;Setup VMEDS() array, which contains medication and prescription data
- ;for each medication in the billing items record:
- ;
- ; .VMEDS - Array of V Medication IEN #s (9000010.14)
- ; VMEDS(0) = <Total Number>
- ; VMEDS(N) = $P=1 --> <V Medication IEN>
- ; $P=2 --> <RXIEN>
- ; $P=3 --> <RXRFIEN>
- ; $P=4 --> <VCPTIEN>
- ; $P=5 --> pointer to 9002313.59
- ;----------------------------------------------------------------------
- GETVMED(VMEDS) ;
- ;Manage local variables
- N NEXT,COUNT,RXIEN,RXRFIEN,VMEDIEN,VCPTIEN,ABSBRXI
- ;
- ;Loop: RXILIST(*) -> VMED(*)
- ;
- S (NEXT,COUNT)=0
- F D Q:'NEXT
- .S NEXT=$O(RXILIST(NEXT)) Q:'NEXT
- .S ABSBRXI=NEXT
- .;D SETSLOT^ABSPOSL(ABSBRXI) ; point to prescription's logging
- .N R0,R1 S R0=^ABSPT(ABSBRXI,0),R1=^(1)
- .S VMEDIEN="" ; don't know, don't care
- .S RXIEN=$P(R1,U,11) I 'RXIEN D IMPOSS^ABSPOSUE("DB","TI","RXIEN",,"GETVMED",$T(+0))
- .S RXRFIEN=$P(R1,U,1) I RXRFIEN="" D IMPOSS^ABSPOSUE("DB","TI","RXRFIEN",,"GETVMED",$T(+0))
- .S VCPTIEN=$P(R1,U,3)
- .S COUNT=COUNT+1
- .S VMEDS(COUNT)=VMEDIEN_U_RXIEN_U_RXRFIEN_U_VCPTIEN_U_ABSBRXI
- .;D RELSLOT^ABSPOSL ; release slot for this prescription
- ;
- S VMEDS(0)=COUNT
- Q
- ABSPOSCB ; IHS/FCS/DRS - VMEDS(*) prep for ABSP(*) ; [ 09/12/2002 10:07 AM ]
- +1 ;;1.0;PHARMACY POINT OF SALE;**3**;JUN 21, 2001;Build 38
- +2 ;----------------------------------------------------------------------
- +3 ;----------------------------------------------------------------------
- +4 ; Called from ABSPOSCA from ABSPOSQG from ABSPOSQ2
- +5 ;Setup ABSP() array which contains all pertinent data to create
- +6 ;Claim Submission Records for the current Billing Item Record:
- +7 ;
- +8 ;Parameters: DIALOUT - Dial-out (9002313.55)
- +9 ; .ABSP - Formatted array containing data required
- +10 ; to create claim submission records
- +11 ;----------------------------------------------------------------------
- +12 ;
- +13 QUIT
- ABSP(DIALOUT,ABSP) ;EP
- +1 IF $DATA(RXILIST)<10
- DO IMPOSS^ABSPOSUE("P","TI","bad RXILIST",,,$TEXT(+0))
- +2 NEW PATIEN,VMEDS,NMEDS,INSURER,INSPINS,VSTIEN,INDEX
- +3 ; set up some vars and make very sure some basic data exists
- Begin DoDot:1
- +4 NEW RXI,R0,R1
- SET RXI=$ORDER(RXILIST(""))
- +5 SET R0=^ABSPT(RXI,0)
- SET R1=^(1)
- +6 SET PATIEN=$PIECE(R0,U,6)
- +7 SET VSTIEN=$PIECE(R0,U,7)
- +8 SET INSURER=$PIECE(R1,U,6)
- +9 SET INSPINS=$PIECE(R1,U,8)
- SET INSPINS=$PIECE(^ABSPT(RXI,6),U,INSPINS)
- +10 IF 'PATIEN
- DO IMPOSS^ABSPOSUE("DB","TI","PATIEN",,,$TEXT(+0))
- +11 IF '$DATA(^DPT(PATIEN,0))
- DO IMPOSS^ABSPOSUE("DB","TI","^DPT(PATIEN)",,,$TEXT(+0))
- +12 IF 'VSTIEN
- DO IMPOSS^ABSPOSUE("DB","TI","VSTIEN",,,$TEXT(+0))
- +13 IF '$DATA(^AUPNVSIT(VSTIEN,0))
- DO IMPOSS^ABSPOSUE("DB","TI","^AUPNVSIT(VSITIEN,0)",,,$TEXT(+0))
- End DoDot:1
- +14 ;
- E ;Set up VMEDS(*)=a bunch of pointers to important stuff
- +1 ; Somewhat vestigial but for now, it survives.
- +2 DO GETVMED(.VMEDS)
- +3 IF '$DATA(VMEDS)
- QUIT 551
- +4 IF 'VMEDS(0)
- QUIT 553
- +5 ;
- +6 ;Get general info and set up ABSP array for Patient, Insurer, Site and
- +7 ;NCPDP record format data
- +8 DO GETINFO^ABSPOSCC(DIALOUT,PATIEN,VSTIEN,INSPINS,INSURER)
- +9 ;
- +10 ;Determine number of mediations returned from GetInfo procedure
- +11 SET NMEDS=+$GET(VMEDS(0))
- +12 SET ABSP("RX",0)=NMEDS
- +13 IF NMEDS=0
- QUIT 552
- L ;Get medication and prescription data for each medication
- +1 FOR INDEX=1:1:NMEDS
- DO MEDINFO^ABSPOSCD(VMEDS(INDEX),INDEX,INSPINS)
- +2 QUIT 0
- +3 ;----------------------------------------------------------------------
- +4 ;Setup VMEDS() array, which contains medication and prescription data
- +5 ;for each medication in the billing items record:
- +6 ;
- +7 ; .VMEDS - Array of V Medication IEN #s (9000010.14)
- +8 ; VMEDS(0) = <Total Number>
- +9 ; VMEDS(N) = $P=1 --> <V Medication IEN>
- +10 ; $P=2 --> <RXIEN>
- +11 ; $P=3 --> <RXRFIEN>
- +12 ; $P=4 --> <VCPTIEN>
- +13 ; $P=5 --> pointer to 9002313.59
- +14 ;----------------------------------------------------------------------
- GETVMED(VMEDS) ;
- +1 ;Manage local variables
- +2 NEW NEXT,COUNT,RXIEN,RXRFIEN,VMEDIEN,VCPTIEN,ABSBRXI
- +3 ;
- +4 ;Loop: RXILIST(*) -> VMED(*)
- +5 ;
- +6 SET (NEXT,COUNT)=0
- +7 FOR
- Begin DoDot:1
- +8 SET NEXT=$ORDER(RXILIST(NEXT))
- IF 'NEXT
- QUIT
- +9 SET ABSBRXI=NEXT
- +10 ;D SETSLOT^ABSPOSL(ABSBRXI) ; point to prescription's logging
- +11 NEW R0,R1
- SET R0=^ABSPT(ABSBRXI,0)
- SET R1=^(1)
- +12 ; don't know, don't care
- SET VMEDIEN=""
- +13 SET RXIEN=$PIECE(R1,U,11)
- IF 'RXIEN
- DO IMPOSS^ABSPOSUE("DB","TI","RXIEN",,"GETVMED",$TEXT(+0))
- +14 SET RXRFIEN=$PIECE(R1,U,1)
- IF RXRFIEN=""
- DO IMPOSS^ABSPOSUE("DB","TI","RXRFIEN",,"GETVMED",$TEXT(+0))
- +15 SET VCPTIEN=$PIECE(R1,U,3)
- +16 SET COUNT=COUNT+1
- +17 SET VMEDS(COUNT)=VMEDIEN_U_RXIEN_U_RXRFIEN_U_VCPTIEN_U_ABSBRXI
- +18 ;D RELSLOT^ABSPOSL ; release slot for this prescription
- End DoDot:1
- IF 'NEXT
- QUIT
- +19 ;
- +20 SET VMEDS(0)=COUNT
- +21 QUIT