ABSPECP3 ; IHS/FCS/DRS - Receipts ; [ 09/19/2002 10:16 AM ]
;;1.0;PHARMACY POINT OF SALE;**3,42**;JUN 21, 2001;Build 38
;
;-----------------------------------------------------------------
;IHS/SD/lwj 9/19/02 NCPDP 5.1 changes
; There were many, many changes with the coming of NCPDP 5.1. One
; is that 42% of the existing claim fields, and 50% of the existing
; result fields changed field type, value types, and field names.
; The changes in field names cause this program a little grief
; so adjustments were made accordingly.
;
;
;-----------------------------------------------------------------
;
Q
; TMP("C",field)=value for claim header
; TMP("C",field,"RX",n)=values for claim medication
; TMP("R",field)=values for claim response
; TMP("R",field,"RX",n)=values for medication responses
Q
;
; * BEGIN * for file 9002313.99, Field RECEIPT STYLE
RECEIPT ;EP - from ABSPECP0, RECEIPT^ABSPOS6E
N SRC S SRC="TMP"
D FULL() Q
FULL0 ;EP - from ABSPECP0
W " - RECEIPT -",!
D PRINT("TMP","PCS1") Q
ANMC ;
; Write any kind of page header here
D PRINT("TMP","ANMC1")
Q
; * END * of receipt styles
;
TEST ;O 51:("TMP.OUT":"W") U 51 S SRC="TMP" D FULL() C 51 Q
FULL(DIV,LEV,RX) ; print it all
; WHAT YOU'RE LOOKING FOR PROBABLY IS NOT HERE
; LOOK BELOW, AT "PRINTSEG" INSTEAD!!!!!!!!!!!
; recurse, filling in parameters
I '$D(DIV) D FULL("C"),FULL("R") Q
I '$D(LEV) D D FULL(DIV,0) Q ; header, then prescription come at end
.W " = = = = = ",$S(DIV="C":"CLAIM",DIV="R":"RESPONSE")," = = = = =",!
;
;IHS/SD/lwj 9/19/02 NCPDP 5.1 Prescription Number is now called
; Prescription/Service Ref Num - within the do loop one line
; was commented out and the next 2 lines were added to adjust for chg.
;
I $G(LEV)=1,'$D(RX) D Q
.;S RX=0 F S RX=$O(@SRC@("C","Prescription Number","RX",RX)) Q:'RX D
.S RX=0
.F S RX=$O(@SRC@("C","Prescription/Service Ref Num","RX",RX)) Q:'RX D
..;W " * TMP * Prescription Number ",RX," * TMP * ",!
..D FULL(DIV,LEV,RX)
I '$D(IOM) N IOM S IOM=80
N FIELD,TITLE,VALUE
S FIELD="" F S FIELD=$O(@SRC@(DIV,FIELD)) Q:FIELD="" D
.;W "LEV=",LEV,",FIELD=",FIELD,!
.I LEV=0,$D(@SRC@(DIV,FIELD))>9 Q ; header skips prescription fields
.I LEV=1,$D(@SRC@(DIV,FIELD))<9 Q ; prescription skips header fields
.; Specialized titles are done here
.I 0
.E S TITLE=FIELD_": "
.N OUTPUT
.I LEV=0 S VALUE=@SRC@(DIV,FIELD),OUTPUT=1
.;I LEV=1 ZW DIV,FIELD,RX R ">>",%,!
.I LEV=1 D
..I FIELD="Reject Code" D S OUTPUT=0 Q
...N X,I S X="" F I=0:1 S X=$O(@SRC@(DIV,FIELD,"RX",RX,X)) Q:X="" D
....S VALUE=@SRC@(DIV,FIELD,"RX",RX,X)
....S TITLE="Reject code: "
....D OUTPUT
..I FIELD="NDC Number" D S OUTPUT=0 Q
...S VALUE=$$FORMTNDC^ABSPOS9($TR(@SRC@(DIV,FIELD,"RX",RX),"-",""))
...D OUTPUT
..I FIELD="DUR Response Data" D S OUTPUT=0 Q
...N X S X=@SRC@(DIV,FIELD,"RX",RX)
...S VALUE="" D OUTPUT ; "DUR Response Data:"
...N FIELD
...D DUROUT(X)
..I FIELD="Preferred Product" D S OUTPUT=0 Q ;OIT/PIERAN/RCS/Patch 42
...N X,I S X="" F I=0:1 S X=$O(@SRC@(DIV,FIELD,"RX",RX,X)) Q:X="" D
....S VALUE=@SRC@(DIV,FIELD,"RX",RX,X)
....S TITLE="Preferred Product "_X_": "
....D OUTPUT
..I FIELD="Additional Information" D S OUTPUT=0 Q ;OIT/PIERAN/RCS/Patch 42
...N X,I S X="" F I=0:1 S X=$O(@SRC@(DIV,FIELD,"RX",RX,X)) Q:X="" D
....S VALUE=@SRC@(DIV,FIELD,"RX",RX,X)
....S TITLE="Additional Information "_X_": "
....D OUTPUT
..S VALUE=@SRC@(DIV,FIELD,"RX",RX),OUTPUT=1
.I OUTPUT D OUTPUT
I LEV=0 W " - - Prescription - -",! D FULL(DIV,1)
Q
OUTPUT ; TITLE,VALUE,!
W TITLE
N X S X=VALUE
N Y S Y=IOM-$X-1 W $E(X,1,Y) S X=$E(X,Y+1,$L(X))
F W ! Q:X="" W $E(X,1,IOM) S X=$E(X,IOM+1,$L(X))
Q
DUROUT(X) ; output of DUR string
N I,L,Y S L=53 F I=0:1:2 D
.N Y S Y=$E(X,I*L+1,I*L+L)
.I Y?." " Q ; blank section
.I $E(Y,1,2)=" 0" Q ; PCS test has this
.I $E(Y,1,2)=" " Q ; PCS test has this
.I $E(Y,1,2)="0 " Q ; PCS test has this (?)
.I I W " - - - DUR response data, part ",I+1," - - -",!
.D DUROUT1(Y)
Q
DUROUT1(X) ; output of one substring of DUR string
N Y
S TITLE=" Drug Conflict Code: ",VALUE=$$DUR^ABSPECP2($E(X,1,2))
D OUTPUT
S TITLE=" Severity Index Code: ",VALUE=$E(X,3) D OUTPUT
S TITLE=" Other Pharmacy Indicator: "
S VALUE=$$OTHPHARM^ABSPECP2($E(X,4)) D OUTPUT
S TITLE=" Previous Date of Fill: ",VALUE=$E(X,5,12)
I VALUE?8N,VALUE>19900000 S Y=VALUE-17000000 X ^DD("DD") S VALUE=Y
D OUTPUT
S TITLE=" Qty. of Previous Fill: ",VALUE=+$E(X,13,17) D OUTPUT
S TITLE=" Database Indicator: ",VALUE=$E(X,18) D OUTPUT
S TITLE=" Other Prescriber Indicator: "
S VALUE=$$OTHPRESC^ABSPECP2($E(X,19)) D OUTPUT
S TITLE=" Message: ",VALUE=$E(X,20,49) D OUTPUT
; bytes 50-53 reserved
Q
PRINT(SRC,FORMAT) ;
D PRINTSEG("C0"_FORMAT)
D PRINTSEG("R0"_FORMAT)
N RX S RX=0
F S RX=$O(@SRC@("C","Prescription Number","RX",RX)) Q:'RX D
.D PRINTSEG("C1"_FORMAT)
.D PRINTSEG("R1"_FORMAT)
Q
PRINTSEG(SEG) ;
N DIV S DIV=$E(SEG)
N LINE,STOP F LINE=0:1 D Q:$G(STOP)
.N X S X=$T(@SEG+LINE) I X'[";;" D IMPOSS^ABSPOSUE("P","TI",SEG,,"PRINTSEG",$T(+0)) ; internal error ; missing "*"
.N FIELD S FIELD=$P(X,";",3)
.I FIELD="*" S STOP=1 Q
.F Q:$E(FIELD)'=" " S FIELD=$E(FIELD,2,$L(FIELD)) ; leading sp okay
.Q:FIELD="" ; empty entry is okay
.I FIELD="Reject Code" D Q
. .N X,I S X="" F I=0:1 S X=$O(@SRC@(DIV,FIELD,"RX",RX,X)) Q:X="" D
. . .S VALUE=@SRC@(DIV,FIELD,"RX",RX,X)
. . .S TITLE=FIELD_":"
. . .D OUTPUT
.I FIELD="DUR Response Data" D Q
. .S X=$G(@SRC@(DIV,FIELD,"RX",RX))
. .S TITLE=FIELD_":",VALUE=""
. .I X="" S TITLE="No "_FIELD D OUTPUT Q
. .S VALUE="" D OUTPUT ; "DUR Response Data"
. .N FIELD D DUROUT(X)
.N VALUE D GETVALUE
.N TITLE S TITLE=$P(X,";",4)
.;ZW TITLE R ">>",%,! ZW VALUE R ">>",%,!
.I TITLE="" S TITLE=FIELD_": "
.E X TITLE
.;ZW TITLE R ">>",%,!
.I FORMAT'="PCS",VALUE=""!(VALUE?." ") Q
.D OUTPUT
Q
GETVALUE ; given SEG,FIELD,RX
I $E(SEG,2)=0 D ; a header field
.S VALUE=$G(@SRC@($E(SEG),FIELD))
E I $E(SEG,2)=1 D ; a prescription field
.S VALUE=$G(@SRC@($E(SEG),FIELD,"RX",RX))
E D IMPOSS^ABSPOSUE("P","TI",SEG,,"GETVALUE",$T(+0)) ; internal error
Q
; Piece 3 - field name
; Piece 4 - execute to set TITLE=something based on FIELD and VALUE
;Cn is for the claim, Rn is for the response
;x0 is for the header, x1 is for the prescription
;xxPCS1 is for the receipt for the PCS certification testing
;xxANMC1 is for the ANMC receipt
C0ANMC1 ;;Patient Name;S TITLE=""
;;Cardholder ID Number
;;Electronic Payor
;;Claim ID
;;*
;;
C0PCS1 ;;Patient Name;S TITLE=""
;;Group Number
;;Cardholder ID Number
;;Electronic Payor
;;Pharmacy Number
;;Claim ID
;;Transaction Code
;;*
C1ANMC1 ;;Medication Name;S TITLE=""
;;Metric Quantity;S TITLE="Quantity: "
;;NDC Number
;;Date Filled
;;Prescription Number
;;Transmitted On;S TITLE="Claim sent "
;;*
C1PCS1 ;;Medication Name;S TITLE=""
;;Date Filled
;;Metric Quantity
;;Prescription Number
;;NDC Number
;;DUR Response Data
;;Reject Code
;;*
R0ANMC1 ;;
;;*
R0PCS1 ;;
;;*
R1ANMC1 ;;Response Status (Prescription);S TITLE="Prescription Status:"
;;Authorization Number
;;DUR Response Data
;;Reject Code
;;Message
;;Message (more)
;;*
R1PCS1 ;;
;;Response Status (Prescription);S TITLE=""
;;Authorization Number
;;Patient Pay Amount;S TITLE=$J(FIELD,21)
;;Ingredient Cost Paid;S TITLE=$J(FIELD,21)
;;Contract Fee Paid;S TITLE=$J(FIELD,21)
;;Sales Tax Paid;S TITLE=$J(FIELD,21)
;;Total Amount Paid;S TITLE=$J(FIELD,21)
;;*
C0ALL ;;Claim ID
;;Electronic Payor
;;Billing Item IEN
;;Transmit Flag
;;Transmitted On
;;Created On
;;Patient Name
;;Billing Item PCN #
;;Billing Item VCN #
;;BIN Number
;;Version/Release Number
;;Transaction Code
;;Processor Control Number
;;Pharmacy Number
;;Group Number
;;Cardholder ID Number
;;Person Code
;;Date of Birth
;;Sex Code
;;Relationship Code
;;Customer Location
;;Other Coverage Code
;;Eligibility Clarification Code
;;Patient First Name
;;Patient Last Name
;;*
C1ALL ;;Date Filled
;;Prescription Number
;;New/Refill Code
;;Metric Quantity
;;Days Supply
;;Compound Code
;;NDC Number
;;Dispense As Written
;;Ingredient Cost
;;Sales Tax
;;Prescriber ID
;;Dispensing Fee Submitted
;;Date Prescription Written
;;Number Refills Authorized
;;PA/MC Code & Number
;;Level of Service
;;Prescription Origin Code
;;Prescription Clarification
;;Primary Prescriber
;;Clinic ID N
;;*
R0ALL ;;
;;*
R1ALL ;;
;;*
ABSPECP3 ; IHS/FCS/DRS - Receipts ; [ 09/19/2002 10:16 AM ]
+1 ;;1.0;PHARMACY POINT OF SALE;**3,42**;JUN 21, 2001;Build 38
+2 ;
+3 ;-----------------------------------------------------------------
+4 ;IHS/SD/lwj 9/19/02 NCPDP 5.1 changes
+5 ; There were many, many changes with the coming of NCPDP 5.1. One
+6 ; is that 42% of the existing claim fields, and 50% of the existing
+7 ; result fields changed field type, value types, and field names.
+8 ; The changes in field names cause this program a little grief
+9 ; so adjustments were made accordingly.
+10 ;
+11 ;
+12 ;-----------------------------------------------------------------
+13 ;
+14 QUIT
+15 ; TMP("C",field)=value for claim header
+16 ; TMP("C",field,"RX",n)=values for claim medication
+17 ; TMP("R",field)=values for claim response
+18 ; TMP("R",field,"RX",n)=values for medication responses
+19 QUIT
+20 ;
+21 ; * BEGIN * for file 9002313.99, Field RECEIPT STYLE
RECEIPT ;EP - from ABSPECP0, RECEIPT^ABSPOS6E
+1 NEW SRC
SET SRC="TMP"
+2 DO FULL()
QUIT
FULL0 ;EP - from ABSPECP0
+1 WRITE " - RECEIPT -",!
+2 DO PRINT("TMP","PCS1")
QUIT
ANMC ;
+1 ; Write any kind of page header here
+2 DO PRINT("TMP","ANMC1")
+3 QUIT
+4 ; * END * of receipt styles
+5 ;
TEST ;O 51:("TMP.OUT":"W") U 51 S SRC="TMP" D FULL() C 51 Q
FULL(DIV,LEV,RX) ; print it all
+1 ; WHAT YOU'RE LOOKING FOR PROBABLY IS NOT HERE
+2 ; LOOK BELOW, AT "PRINTSEG" INSTEAD!!!!!!!!!!!
+3 ; recurse, filling in parameters
+4 IF '$DATA(DIV)
DO FULL("C")
DO FULL("R")
QUIT
+5 ; header, then prescription come at end
IF '$DATA(LEV)
Begin DoDot:1
+6 WRITE " = = = = = ",$SELECT(DIV="C":"CLAIM",DIV="R":"RESPONSE")," = = = = =",!
End DoDot:1
DO FULL(DIV,0)
QUIT
+7 ;
+8 ;IHS/SD/lwj 9/19/02 NCPDP 5.1 Prescription Number is now called
+9 ; Prescription/Service Ref Num - within the do loop one line
+10 ; was commented out and the next 2 lines were added to adjust for chg.
+11 ;
+12 IF $GET(LEV)=1
IF '$DATA(RX)
Begin DoDot:1
+13 ;S RX=0 F S RX=$O(@SRC@("C","Prescription Number","RX",RX)) Q:'RX D
+14 SET RX=0
+15 FOR
SET RX=$ORDER(@SRC@("C","Prescription/Service Ref Num","RX",RX))
IF 'RX
QUIT
Begin DoDot:2
+16 ;W " * TMP * Prescription Number ",RX," * TMP * ",!
+17 DO FULL(DIV,LEV,RX)
End DoDot:2
End DoDot:1
QUIT
+18 IF '$DATA(IOM)
NEW IOM
SET IOM=80
+19 NEW FIELD,TITLE,VALUE
+20 SET FIELD=""
FOR
SET FIELD=$ORDER(@SRC@(DIV,FIELD))
IF FIELD=""
QUIT
Begin DoDot:1
+21 ;W "LEV=",LEV,",FIELD=",FIELD,!
+22 ; header skips prescription fields
IF LEV=0
IF $DATA(@SRC@(DIV,FIELD))>9
QUIT
+23 ; prescription skips header fields
IF LEV=1
IF $DATA(@SRC@(DIV,FIELD))<9
QUIT
+24 ; Specialized titles are done here
+25 IF 0
+26 IF '$TEST
SET TITLE=FIELD_": "
+27 NEW OUTPUT
+28 IF LEV=0
SET VALUE=@SRC@(DIV,FIELD)
SET OUTPUT=1
+29 ;I LEV=1 ZW DIV,FIELD,RX R ">>",%,!
+30 IF LEV=1
Begin DoDot:2
+31 IF FIELD="Reject Code"
Begin DoDot:3
+32 NEW X,I
SET X=""
FOR I=0:1
SET X=$ORDER(@SRC@(DIV,FIELD,"RX",RX,X))
IF X=""
QUIT
Begin DoDot:4
+33 SET VALUE=@SRC@(DIV,FIELD,"RX",RX,X)
+34 SET TITLE="Reject code: "
+35 DO OUTPUT
End DoDot:4
End DoDot:3
SET OUTPUT=0
QUIT
+36 IF FIELD="NDC Number"
Begin DoDot:3
+37 SET VALUE=$$FORMTNDC^ABSPOS9($TRANSLATE(@SRC@(DIV,FIELD,"RX",RX),"-",""))
+38 DO OUTPUT
End DoDot:3
SET OUTPUT=0
QUIT
+39 IF FIELD="DUR Response Data"
Begin DoDot:3
+40 NEW X
SET X=@SRC@(DIV,FIELD,"RX",RX)
+41 ; "DUR Response Data:"
SET VALUE=""
DO OUTPUT
+42 NEW FIELD
+43 DO DUROUT(X)
End DoDot:3
SET OUTPUT=0
QUIT
+44 ;OIT/PIERAN/RCS/Patch 42
IF FIELD="Preferred Product"
Begin DoDot:3
+45 NEW X,I
SET X=""
FOR I=0:1
SET X=$ORDER(@SRC@(DIV,FIELD,"RX",RX,X))
IF X=""
QUIT
Begin DoDot:4
+46 SET VALUE=@SRC@(DIV,FIELD,"RX",RX,X)
+47 SET TITLE="Preferred Product "_X_": "
+48 DO OUTPUT
End DoDot:4
End DoDot:3
SET OUTPUT=0
QUIT
+49 ;OIT/PIERAN/RCS/Patch 42
IF FIELD="Additional Information"
Begin DoDot:3
+50 NEW X,I
SET X=""
FOR I=0:1
SET X=$ORDER(@SRC@(DIV,FIELD,"RX",RX,X))
IF X=""
QUIT
Begin DoDot:4
+51 SET VALUE=@SRC@(DIV,FIELD,"RX",RX,X)
+52 SET TITLE="Additional Information "_X_": "
+53 DO OUTPUT
End DoDot:4
End DoDot:3
SET OUTPUT=0
QUIT
+54 SET VALUE=@SRC@(DIV,FIELD,"RX",RX)
SET OUTPUT=1
End DoDot:2
+55 IF OUTPUT
DO OUTPUT
End DoDot:1
+56 IF LEV=0
WRITE " - - Prescription - -",!
DO FULL(DIV,1)
+57 QUIT
OUTPUT ; TITLE,VALUE,!
+1 WRITE TITLE
+2 NEW X
SET X=VALUE
+3 NEW Y
SET Y=IOM-$X-1
WRITE $EXTRACT(X,1,Y)
SET X=$EXTRACT(X,Y+1,$LENGTH(X))
+4 FOR
WRITE !
IF X=""
QUIT
WRITE $EXTRACT(X,1,IOM)
SET X=$EXTRACT(X,IOM+1,$LENGTH(X))
+5 QUIT
DUROUT(X) ; output of DUR string
+1 NEW I,L,Y
SET L=53
FOR I=0:1:2
Begin DoDot:1
+2 NEW Y
SET Y=$EXTRACT(X,I*L+1,I*L+L)
+3 ; blank section
IF Y?." "
QUIT
+4 ; PCS test has this
IF $EXTRACT(Y,1,2)=" 0"
QUIT
+5 ; PCS test has this
IF $EXTRACT(Y,1,2)=" "
QUIT
+6 ; PCS test has this (?)
IF $EXTRACT(Y,1,2)="0 "
QUIT
+7 IF I
WRITE " - - - DUR response data, part ",I+1," - - -",!
+8 DO DUROUT1(Y)
End DoDot:1
+9 QUIT
DUROUT1(X) ; output of one substring of DUR string
+1 NEW Y
+2 SET TITLE=" Drug Conflict Code: "
SET VALUE=$$DUR^ABSPECP2($EXTRACT(X,1,2))
+3 DO OUTPUT
+4 SET TITLE=" Severity Index Code: "
SET VALUE=$EXTRACT(X,3)
DO OUTPUT
+5 SET TITLE=" Other Pharmacy Indicator: "
+6 SET VALUE=$$OTHPHARM^ABSPECP2($EXTRACT(X,4))
DO OUTPUT
+7 SET TITLE=" Previous Date of Fill: "
SET VALUE=$EXTRACT(X,5,12)
+8 IF VALUE?8N
IF VALUE>19900000
SET Y=VALUE-17000000
XECUTE ^DD("DD")
SET VALUE=Y
+9 DO OUTPUT
+10 SET TITLE=" Qty. of Previous Fill: "
SET VALUE=+$EXTRACT(X,13,17)
DO OUTPUT
+11 SET TITLE=" Database Indicator: "
SET VALUE=$EXTRACT(X,18)
DO OUTPUT
+12 SET TITLE=" Other Prescriber Indicator: "
+13 SET VALUE=$$OTHPRESC^ABSPECP2($EXTRACT(X,19))
DO OUTPUT
+14 SET TITLE=" Message: "
SET VALUE=$EXTRACT(X,20,49)
DO OUTPUT
+15 ; bytes 50-53 reserved
+16 QUIT
PRINT(SRC,FORMAT) ;
+1 DO PRINTSEG("C0"_FORMAT)
+2 DO PRINTSEG("R0"_FORMAT)
+3 NEW RX
SET RX=0
+4 FOR
SET RX=$ORDER(@SRC@("C","Prescription Number","RX",RX))
IF 'RX
QUIT
Begin DoDot:1
+5 DO PRINTSEG("C1"_FORMAT)
+6 DO PRINTSEG("R1"_FORMAT)
End DoDot:1
+7 QUIT
PRINTSEG(SEG) ;
+1 NEW DIV
SET DIV=$EXTRACT(SEG)
+2 NEW LINE,STOP
FOR LINE=0:1
Begin DoDot:1
+3 ; internal error ; missing "*"
NEW X
SET X=$TEXT(@SEG+LINE)
IF X'[";;"
DO IMPOSS^ABSPOSUE("P","TI",SEG,,"PRINTSEG",$TEXT(+0))
+4 NEW FIELD
SET FIELD=$PIECE(X,";",3)
+5 IF FIELD="*"
SET STOP=1
QUIT
+6 ; leading sp okay
FOR
IF $EXTRACT(FIELD)'=" "
QUIT
SET FIELD=$EXTRACT(FIELD,2,$LENGTH(FIELD))
+7 ; empty entry is okay
IF FIELD=""
QUIT
+8 IF FIELD="Reject Code"
Begin DoDot:2
+9 NEW X,I
SET X=""
FOR I=0:1
SET X=$ORDER(@SRC@(DIV,FIELD,"RX",RX,X))
IF X=""
QUIT
Begin DoDot:3
+10 SET VALUE=@SRC@(DIV,FIELD,"RX",RX,X)
+11 SET TITLE=FIELD_":"
+12 DO OUTPUT
End DoDot:3
End DoDot:2
QUIT
+13 IF FIELD="DUR Response Data"
Begin DoDot:2
+14 SET X=$GET(@SRC@(DIV,FIELD,"RX",RX))
+15 SET TITLE=FIELD_":"
SET VALUE=""
+16 IF X=""
SET TITLE="No "_FIELD
DO OUTPUT
QUIT
+17 ; "DUR Response Data"
SET VALUE=""
DO OUTPUT
+18 NEW FIELD
DO DUROUT(X)
End DoDot:2
QUIT
+19 NEW VALUE
DO GETVALUE
+20 NEW TITLE
SET TITLE=$PIECE(X,";",4)
+21 ;ZW TITLE R ">>",%,! ZW VALUE R ">>",%,!
+22 IF TITLE=""
SET TITLE=FIELD_": "
+23 IF '$TEST
XECUTE TITLE
+24 ;ZW TITLE R ">>",%,!
+25 IF FORMAT'="PCS"
IF VALUE=""!(VALUE?." ")
QUIT
+26 DO OUTPUT
End DoDot:1
IF $GET(STOP)
QUIT
+27 QUIT
GETVALUE ; given SEG,FIELD,RX
+1 ; a header field
IF $EXTRACT(SEG,2)=0
Begin DoDot:1
+2 SET VALUE=$GET(@SRC@($EXTRACT(SEG),FIELD))
End DoDot:1
+3 ; a prescription field
IF '$TEST
IF $EXTRACT(SEG,2)=1
Begin DoDot:1
+4 SET VALUE=$GET(@SRC@($EXTRACT(SEG),FIELD,"RX",RX))
End DoDot:1
+5 ; internal error
IF '$TEST
DO IMPOSS^ABSPOSUE("P","TI",SEG,,"GETVALUE",$TEXT(+0))
+6 QUIT
+7 ; Piece 3 - field name
+8 ; Piece 4 - execute to set TITLE=something based on FIELD and VALUE
+9 ;Cn is for the claim, Rn is for the response
+10 ;x0 is for the header, x1 is for the prescription
+11 ;xxPCS1 is for the receipt for the PCS certification testing
+12 ;xxANMC1 is for the ANMC receipt
C0ANMC1 ;;Patient Name;S TITLE=""
+1 ;;Cardholder ID Number
+2 ;;Electronic Payor
+3 ;;Claim ID
+4 ;;*
+5 ;;
C0PCS1 ;;Patient Name;S TITLE=""
+1 ;;Group Number
+2 ;;Cardholder ID Number
+3 ;;Electronic Payor
+4 ;;Pharmacy Number
+5 ;;Claim ID
+6 ;;Transaction Code
+7 ;;*
C1ANMC1 ;;Medication Name;S TITLE=""
+1 ;;Metric Quantity;S TITLE="Quantity: "
+2 ;;NDC Number
+3 ;;Date Filled
+4 ;;Prescription Number
+5 ;;Transmitted On;S TITLE="Claim sent "
+6 ;;*
C1PCS1 ;;Medication Name;S TITLE=""
+1 ;;Date Filled
+2 ;;Metric Quantity
+3 ;;Prescription Number
+4 ;;NDC Number
+5 ;;DUR Response Data
+6 ;;Reject Code
+7 ;;*
R0ANMC1 ;;
+1 ;;*
R0PCS1 ;;
+1 ;;*
R1ANMC1 ;;Response Status (Prescription);S TITLE="Prescription Status:"
+1 ;;Authorization Number
+2 ;;DUR Response Data
+3 ;;Reject Code
+4 ;;Message
+5 ;;Message (more)
+6 ;;*
R1PCS1 ;;
+1 ;;Response Status (Prescription);S TITLE=""
+2 ;;Authorization Number
+3 ;;Patient Pay Amount;S TITLE=$J(FIELD,21)
+4 ;;Ingredient Cost Paid;S TITLE=$J(FIELD,21)
+5 ;;Contract Fee Paid;S TITLE=$J(FIELD,21)
+6 ;;Sales Tax Paid;S TITLE=$J(FIELD,21)
+7 ;;Total Amount Paid;S TITLE=$J(FIELD,21)
+8 ;;*
C0ALL ;;Claim ID
+1 ;;Electronic Payor
+2 ;;Billing Item IEN
+3 ;;Transmit Flag
+4 ;;Transmitted On
+5 ;;Created On
+6 ;;Patient Name
+7 ;;Billing Item PCN #
+8 ;;Billing Item VCN #
+9 ;;BIN Number
+10 ;;Version/Release Number
+11 ;;Transaction Code
+12 ;;Processor Control Number
+13 ;;Pharmacy Number
+14 ;;Group Number
+15 ;;Cardholder ID Number
+16 ;;Person Code
+17 ;;Date of Birth
+18 ;;Sex Code
+19 ;;Relationship Code
+20 ;;Customer Location
+21 ;;Other Coverage Code
+22 ;;Eligibility Clarification Code
+23 ;;Patient First Name
+24 ;;Patient Last Name
+25 ;;*
C1ALL ;;Date Filled
+1 ;;Prescription Number
+2 ;;New/Refill Code
+3 ;;Metric Quantity
+4 ;;Days Supply
+5 ;;Compound Code
+6 ;;NDC Number
+7 ;;Dispense As Written
+8 ;;Ingredient Cost
+9 ;;Sales Tax
+10 ;;Prescriber ID
+11 ;;Dispensing Fee Submitted
+12 ;;Date Prescription Written
+13 ;;Number Refills Authorized
+14 ;;PA/MC Code & Number
+15 ;;Level of Service
+16 ;;Prescription Origin Code
+17 ;;Prescription Clarification
+18 ;;Primary Prescriber
+19 ;;Clinic ID N
+20 ;;*
R0ALL ;;
+1 ;;*
R1ALL ;;
+1 ;;*