ECXPRO2 ;ALB/GTS - Prosthetics Extract for DSS (Continued) ;3/26/15 16:38
;;3.0;DSS EXTRACTS;**9,15,21,24,33,127,132,154**;Dec 22, 1997;Build 13
;
ECXBUL(ECXLNE,ECXEBDT,ECXEEDT,ECNUM) ;* Set up the header for the exception msg
;
; Input
; ECXLNE - The line number variable (passed by reference)
; ECXEBDT - The Externally formatted beginning date
; ECXEEDT - The Externally formatted ending date
; ECNUM - The Extract reference number
;
; Output
; ^TMP("ECX-PRO EXC",$J) - Array for the exception message
; ECXLNE - The number of the next line in the msg
;
S ^TMP("ECX-PRO EXC",$J,1)=" "
S ^TMP("ECX-PRO EXC",$J,2)="The DSS-Prosthetic Extract #"_ECNUM_" for "_ECXEBDT_" through "_ECXEEDT
S ^TMP("ECX-PRO EXC",$J,3)="has completed. The following is a list of Prosthetics records that were NOT"
S ^TMP("ECX-PRO EXC",$J,4)="extracted due to missing information in the Record of Pros Appliance/Repair"
S ^TMP("ECX-PRO EXC",$J,5)="file (#660). The Prosthetics record may be reviewed and the missing"
S ^TMP("ECX-PRO EXC",$J,6)="information completed. Once the missing information has been entered, it"
S ^TMP("ECX-PRO EXC",$J,7)="will be necessary to re-generate the Prosthetics Extract for the above noted"
S ^TMP("ECX-PRO EXC",$J,8)="date range."
S ^TMP("ECX-PRO EXC",$J,9)=" "
S ^TMP("ECX-PRO EXC",$J,10)="If you do not intend to transmit Prosthetics Extract #"_ECNUM_", then please"
S ^TMP("ECX-PRO EXC",$J,11)="purge it before generating a new extract for the same date range."
S ^TMP("ECX-PRO EXC",$J,12)=" "
S ^TMP("ECX-PRO EXC",$J,13)=" "
S ^TMP("ECX-PRO EXC",$J,14)=" PROSTHETICS FILE (#660) MISSING DATA"
S ^TMP("ECX-PRO EXC",$J,15)=" IEN ELEMENTS"
S ^TMP("ECX-PRO EXC",$J,16)=" "
S ECXLNE=15
Q
;
ECXMISLN(ECXMISS,ECXLNE,ECXPIEN) ;** Report Missing Lines
N ECXPCE,ECXFIRST,ECXFIELD
S ECXFIRST=1
F ECXPCE=1:1:11 DO
.I +$P(ECXMISS,"^",ECXPCE) DO
..S ECXFIELD=$P($T(ECXFLD+ECXPCE),";;",2)
..I 'ECXFIRST S ^TMP("ECX-PRO EXC",$J,ECXLNE)=" "_ECXFIELD
..I ECXFIRST DO
...S ^TMP("ECX-PRO EXC",$J,ECXLNE)=" "_ECXPIEN_" "_ECXFIELD
...S ECXFIRST=0
..S ECXLNE=ECXLNE+1
S ^TMP("ECX-PRO EXC",$J,ECXLNE)=" "
S ECXLNE=ECXLNE+1
Q
;
ECXFLD ;* Missing Required fields
;;STATION
;;PATIENT NAME (Invalid)
;;SSN
;;NAME (In Patient file - #2)
;;DELIVERY DATE
;;TYPE OF TRANSACTION
;;SOURCE
;;HCPCS
;;REQUESTING STATION
;;FORM REQUESTED ON
;;RECEIVING STATION
Q
;
FEEDINFO(ECXSRCE,ECXHCPCS,ECXTYPE,ECXSTAT2,ECXRQST,ECXRCST,ECXLAB,ECXNPPDC) ;Get Feeder Key and Feeder Location
; Input
; ECXSTAT2 - Station Number for extract
; ECXTYPE - Type of Transaction work performed
; ECXSRCE - Source of prosthesis
; ECXHCPCS - HCPCS code for prosthesis
; ECXRQST - Requesting Station
; ECXRCST - Receiving Station
; ECXLAB - Lab or non-Lab
; ECXNPPDC - NPPD Code
; Output (to be KILLed by calling routine)
; ECXFELOC - Feeder Location
; ECXFEKEY - Feeder Key
;
;* NOTE: If a Station # <> Requesting Station
;* AND
;* Station # <> Receiving Station,
;* then Feeder Location will be NULL.
;
S ECXFELOC=""
S ECXFEKEY=ECXHCPCS_$S(ECXTYPE="X":"X",ECXTYPE=5:"R",1:"N")_ECXSRCE
;
;* If processing a Non-Lab Transaction
I ECXLAB="NONL" S ECXFELOC=ECXSTAT2_$S(ECXNPPDC[800:"HO2",1:"NONL")
;
;* If processing a Lab Transaction
I ECXLAB="LAB" D ;154 Removed Q so processing continues
.I ECXSTAT2=ECXRCST D
..S ECXFELOC=ECXRCST_"LAB"
..S ECXFEKEY=ECXFEKEY_ECXRQST_"REQ"
I ECXLAB="ORD" D ;154 Removed Q so processing continues
.I ECXSTAT2=ECXRQST D
..S ECXFELOC=ECXRQST_"ORD"
..S ECXFEKEY=ECXFEKEY_ECXRCST_"REC"
S ECXFEKEY=ECXFEKEY_$S($P($G(ECXFORM),U,2)=11:"S",$P($G(ECXFORM),U,2)=12:"I",1:"") ;154 If form requested on is stock, add "S", if inventory add "I"
;
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HECXPRO2 4041 printed Oct 16, 2024@17:54:18 Page 2
ECXPRO2 ;ALB/GTS - Prosthetics Extract for DSS (Continued) ;3/26/15 16:38
+1 ;;3.0;DSS EXTRACTS;**9,15,21,24,33,127,132,154**;Dec 22, 1997;Build 13
+2 ;
ECXBUL(ECXLNE,ECXEBDT,ECXEEDT,ECNUM) ;* Set up the header for the exception msg
+1 ;
+2 ; Input
+3 ; ECXLNE - The line number variable (passed by reference)
+4 ; ECXEBDT - The Externally formatted beginning date
+5 ; ECXEEDT - The Externally formatted ending date
+6 ; ECNUM - The Extract reference number
+7 ;
+8 ; Output
+9 ; ^TMP("ECX-PRO EXC",$J) - Array for the exception message
+10 ; ECXLNE - The number of the next line in the msg
+11 ;
+12 SET ^TMP("ECX-PRO EXC",$JOB,1)=" "
+13 SET ^TMP("ECX-PRO EXC",$JOB,2)="The DSS-Prosthetic Extract #"_ECNUM_" for "_ECXEBDT_" through "_ECXEEDT
+14 SET ^TMP("ECX-PRO EXC",$JOB,3)="has completed. The following is a list of Prosthetics records that were NOT"
+15 SET ^TMP("ECX-PRO EXC",$JOB,4)="extracted due to missing information in the Record of Pros Appliance/Repair"
+16 SET ^TMP("ECX-PRO EXC",$JOB,5)="file (#660). The Prosthetics record may be reviewed and the missing"
+17 SET ^TMP("ECX-PRO EXC",$JOB,6)="information completed. Once the missing information has been entered, it"
+18 SET ^TMP("ECX-PRO EXC",$JOB,7)="will be necessary to re-generate the Prosthetics Extract for the above noted"
+19 SET ^TMP("ECX-PRO EXC",$JOB,8)="date range."
+20 SET ^TMP("ECX-PRO EXC",$JOB,9)=" "
+21 SET ^TMP("ECX-PRO EXC",$JOB,10)="If you do not intend to transmit Prosthetics Extract #"_ECNUM_", then please"
+22 SET ^TMP("ECX-PRO EXC",$JOB,11)="purge it before generating a new extract for the same date range."
+23 SET ^TMP("ECX-PRO EXC",$JOB,12)=" "
+24 SET ^TMP("ECX-PRO EXC",$JOB,13)=" "
+25 SET ^TMP("ECX-PRO EXC",$JOB,14)=" PROSTHETICS FILE (#660) MISSING DATA"
+26 SET ^TMP("ECX-PRO EXC",$JOB,15)=" IEN ELEMENTS"
+27 SET ^TMP("ECX-PRO EXC",$JOB,16)=" "
+28 SET ECXLNE=15
+29 QUIT
+30 ;
ECXMISLN(ECXMISS,ECXLNE,ECXPIEN) ;** Report Missing Lines
+1 NEW ECXPCE,ECXFIRST,ECXFIELD
+2 SET ECXFIRST=1
+3 FOR ECXPCE=1:1:11
Begin DoDot:1
+4 IF +$PIECE(ECXMISS,"^",ECXPCE)
Begin DoDot:2
+5 SET ECXFIELD=$PIECE($TEXT(ECXFLD+ECXPCE),";;",2)
+6 IF 'ECXFIRST
SET ^TMP("ECX-PRO EXC",$JOB,ECXLNE)=" "_ECXFIELD
+7 IF ECXFIRST
Begin DoDot:3
+8 SET ^TMP("ECX-PRO EXC",$JOB,ECXLNE)=" "_ECXPIEN_" "_ECXFIELD
+9 SET ECXFIRST=0
End DoDot:3
+10 SET ECXLNE=ECXLNE+1
End DoDot:2
End DoDot:1
+11 SET ^TMP("ECX-PRO EXC",$JOB,ECXLNE)=" "
+12 SET ECXLNE=ECXLNE+1
+13 QUIT
+14 ;
ECXFLD ;* Missing Required fields
+1 ;;STATION
+2 ;;PATIENT NAME (Invalid)
+3 ;;SSN
+4 ;;NAME (In Patient file - #2)
+5 ;;DELIVERY DATE
+6 ;;TYPE OF TRANSACTION
+7 ;;SOURCE
+8 ;;HCPCS
+9 ;;REQUESTING STATION
+10 ;;FORM REQUESTED ON
+11 ;;RECEIVING STATION
+12 QUIT
+13 ;
FEEDINFO(ECXSRCE,ECXHCPCS,ECXTYPE,ECXSTAT2,ECXRQST,ECXRCST,ECXLAB,ECXNPPDC) ;Get Feeder Key and Feeder Location
+1 ; Input
+2 ; ECXSTAT2 - Station Number for extract
+3 ; ECXTYPE - Type of Transaction work performed
+4 ; ECXSRCE - Source of prosthesis
+5 ; ECXHCPCS - HCPCS code for prosthesis
+6 ; ECXRQST - Requesting Station
+7 ; ECXRCST - Receiving Station
+8 ; ECXLAB - Lab or non-Lab
+9 ; ECXNPPDC - NPPD Code
+10 ; Output (to be KILLed by calling routine)
+11 ; ECXFELOC - Feeder Location
+12 ; ECXFEKEY - Feeder Key
+13 ;
+14 ;* NOTE: If a Station # <> Requesting Station
+15 ;* AND
+16 ;* Station # <> Receiving Station,
+17 ;* then Feeder Location will be NULL.
+18 ;
+19 SET ECXFELOC=""
+20 SET ECXFEKEY=ECXHCPCS_$SELECT(ECXTYPE="X":"X",ECXTYPE=5:"R",1:"N")_ECXSRCE
+21 ;
+22 ;* If processing a Non-Lab Transaction
+23 IF ECXLAB="NONL"
SET ECXFELOC=ECXSTAT2_$SELECT(ECXNPPDC[800:"HO2",1:"NONL")
+24 ;
+25 ;* If processing a Lab Transaction
+26 ;154 Removed Q so processing continues
IF ECXLAB="LAB"
Begin DoDot:1
+27 IF ECXSTAT2=ECXRCST
Begin DoDot:2
+28 SET ECXFELOC=ECXRCST_"LAB"
+29 SET ECXFEKEY=ECXFEKEY_ECXRQST_"REQ"
End DoDot:2
End DoDot:1
+30 ;154 Removed Q so processing continues
IF ECXLAB="ORD"
Begin DoDot:1
+31 IF ECXSTAT2=ECXRQST
Begin DoDot:2
+32 SET ECXFELOC=ECXRQST_"ORD"
+33 SET ECXFEKEY=ECXFEKEY_ECXRCST_"REC"
End DoDot:2
End DoDot:1
+34 ;154 If form requested on is stock, add "S", if inventory add "I"
SET ECXFEKEY=ECXFEKEY_$SELECT($PIECE($GET(ECXFORM),U,2)=11:"S",$PIECE($GET(ECXFORM),U,2)=12:"I",1:"")
+35 ;
+36 QUIT