ECXBCM1 ;ALB/JAP-Bar Code Medical Administration Extract Cont. ;2/14/20 08:49
;;3.0;DSS EXTRACTS;**154,170,174,178,181,184,187**;Dec 22, 1997 ;Build 163
;
; Reference to ^XMD in ICR #10113
; Reference to ^XMB("NETNAME") in ICR #1131
; Reference to ^TMP($J) in SACC 2.3.2.5.1
; Reference to $$TSDATA^DGACT in ICR #2248
; Reference to IX1^DIK in ICR #10013
;
FILE ;file the extract record
;node0
;Sequence Number,Year Month, Extract Number (EC23)^facility (ECXFAC)^
;dfn (ECXDFN)^ssn (ECXSSN)^name (ECXPNM)^
;in/out (ECXA)^Day (ECXADT)^
;date of birth (ECDOB)^Gender (ECXSEX)^State (ECXSTATE)^County (ECXCNTY)^
;zip code (ECXZIP)^country (ECXCNTRY)^ward (ECXW)^treating specialty (ECXTSC)^
;provider (ECPRO)^provider person class (ECPROPC)^provider npi (ECPRONPI)^
;Placehold primary care provider(ECPTPR)^Placehold pc provider person class (ECCLAS)^
;Placehold primary care provider NPI (ECPTNPI)^Placehold primary care team (ECPTTM)^ordering stop code (ECXOSC)^
;NODE(1)
;place order number (RIEN)^order reference number (ECXORN)^route (ECXORT)^
;^action time (ECXATM)^component code (CCIEN)^
;component dose ordered (CCDORD)^component dose given(CCDGVN)^
;component units (CCUNIT)^component type (CCTYPE)^Action Status (ECXASTA)^
;Administration Medication (ECXAMED)^Scheduled Administration Date (ECXSCADT)^
;NODE(2)
;Scheduled Administration Time (ECXSCATM)^
;Order Schedule (ECXOS)^IV Unique ID (ECXIVID)^
;Infusion Rate (ECXIR)^Production Division Code (ECXDIV)^Drug IEN (ECXVAP)^NDC (ECVNDC)^ ;;143, changed Drug IEN var from DRG to ECXVAP
;Investigational (DEA Special Handling) (ECINV)^VA Drug Classification (ECVACL)^
;Master Patient Index (ECXMPI)^DOM, PRRTP and SAARTP Indicator (ECXDOM)^
;Observation Patient Indicator (ECXOBS)^Encounter Number (ECXENC)^Means Test (ECXMTST)^
;Eligibility (ECXELIG)^Enrollment Location (ECXENRL)^Enrollment Category (ECXCAT)^
;Enrollment Status (ECXSTAT)^Enrollment Priority (ECXPRIOR)_(ECXSBGRP)^
;User Enrollee (ECXUESTA)^
;Placehold Ethnicity(ECXETH)^Placehold Race 1(ECXRC1)^Veteran(ECXVET)^Period of Service(ECXPOS)^POW Status(ECXPST)^
;POW Location(ECXPLOC)^Radiation Status(ECXRST)^Agent Orange Status(ECXAST)^Agent Orange Location(ECXAOL)
;^Purple Heart Indicator(ECXPHI)^MST Status(ECXMST)^CNH/SH Status(ECXCNHU)^
;Head & Neck Cancer Indicator(ECXHNCI)^SHAD Status(ECXSHADI)
;NODE(3)
;Patient Type(ECXPTYPE)^
;CV Status Eligibility(ECXCVE)^CV Eligibility End Date(ECXCVEDT)^Encounter CV(ECXCVENC)^
;National Patient Record Flag(ECXNPRFI)^ERI(ECXERI)^SW Asia Conditions(ECXEST)^
;OEF/OIF(ECXOEF)^OEF/OIF Return Date(ECXOEFDT)^PATCAT(ECXPATCAT)
;Encounter SC (ECXESC)^IV Additives Cost ECXIVAC^IV Solutions Cost ECXIVSC^Drug cost ECXDRGC^Camp Lejeune Status (ECXCLST)^Encounter Camp Lejeune (ECXECL)
;Combat Service Indicator (ECXSVCI) ^ Combat Service Location (ECXSVCL)^ Vista DEA special hdlg (ECXDEA)^New MPI (ECXNMPI)^Feeder Key (ECXFDK)^Price Per Dispense Unit (ECXPPDU)^
;NODE(3) -Cont'd
;Self Identified Gender (ECXSIGI)
;
;convert specialty to PTF Code for transmission
N ECXDATA,ECXTSC
;N ECXNMPI ;184 new field
S ECXDATA=$$TSDATA^DGACT(42.4,+ECXTS,.ECXDATA)
S ECXTSC=$G(ECXDATA(7))
N DA,DIK
S EC7=$O(^ECX(ECFILE,999999999),-1),EC7=EC7+1
I ECXLOGIC>2018 S (ECXETH,ECXRC1,ECPTPR,ECCLAS,ECPTNPI,ECPTTM)="" ;170 Fields will now be null
I ECXLOGIC>2020 S ECXMTST="" ;178 Means Test field will now be null
;I ECXLOGIC>2022 S ECXNMPI=ECXMPI,ECXMPI="" ;184 - field retired.
S ECODE(0)=EC7_U_EC23_U_ECXFAC_U_ECXDFN_U_ECXSSN_U_ECXPNM_U_ECXA_U_ECXADT
S ECODE(0)=ECODE(0)_U_ECXDOB_U_ECXSEX_U_ECXSTATE_U_ECXCNTY_U_ECXZIP_U_ECXCNTRY
S ECODE(0)=ECODE(0)_U_ECXW_U_ECXTSC_U_2_ECPRO_U_ECPROPC_U_ECPRONPI_U_ECPTPR_U_ECCLAS
S ECODE(0)=ECODE(0)_U_ECPTNPI_U_ECPTTM_U_ECXOSC_U
S ECODE(1)=RIEN_U_ECXORN_U_ECXORT_U_ECXATM_U_CCIEN_U_CCDORD_U_CCDGVN
S ECODE(1)=ECODE(1)_U_CCUNIT_U_CCTYPE_U_ECXASTA_U_ECXAMED_U_ECXSCADT_U
S ECODE(2)=ECXSCATM_U_ECXOS_U_ECXIVID_U_ECXIR_U_ECXDIV_U_ECXVAP_U_ECVNDC_U_ECINV_U_ECVACL_U_ECXMPI_U_ECXDOM ;143 Changed DRUG IEN field from DRG to ECXVAP
S ECODE(2)=ECODE(2)_U_$E(ECXOBS,1)_U_ECXENC_U_ECXMTST_U_ECXELIG_U_ECXENRL_U_ECXCAT_U_ECXSTAT_U_ECXPRIOR_ECXSBGRP
S ECODE(2)=ECODE(2)_U_ECXUESTA_U_ECXETH_U_ECXRC1_U_ECXVET_U_ECXPOS_U_ECXPST_U_ECXPLOC
S ECODE(2)=ECODE(2)_U_ECXRST_U_ECXAST_U_ECXAOL_U_ECXPHI_U_ECXMST_U_ECXCNHU_U_ECXHNCI_U_ECXSHADI_U
S ECODE(3)=ECXPTYPE_U_ECXCVE_U_ECXCVEDT_U_ECXCVENC_U_ECXNPRFI_U_ECXERI_U_ECXEST_U_ECXOEF_U_ECXOEFDT
S ECODE(3)=ECODE(3)_U_ECXPATCAT
I ECXLOGIC>2013 S ECODE(3)=ECODE(3)_U_ECXESC_U_ECXIVAC_U_ECXIVSC_U_ECXDRGC_U_ECXCLST_U_ECXECL ;144
I ECXLOGIC>2014 S ECODE(3)=ECODE(3)_U_ECXSVCI_U_ECXSVCL ;149
I ECXLOGIC>2019 S ECODE(3)=ECODE(3)_U_ECXDEA ;174
I ECXLOGIC>2022 S ECODE(3)=ECODE(3)_U_ECXNMPI_U_ECXFDK_U_ECXPPDU_U_ECXSIGI ;184
I ECXLOGIC>2023 S ECODE(3)=ECODE(3)_U_ECXDUNIT ;187
;
N DA,DIK,X S X=""
F X=0:1:3 S ^ECX(ECFILE,EC7,X)=ECODE(X)
S ECRN=ECRN+1
S DA=EC7,DIK="^ECX("_ECFILE_"," D IX1^DIK K DIK,DA
Q
;
SENDMSG ;181 - Called from ECXBCM
N ECMSG,ECX,XMSUB,XMDUZ,XMY,XMTEXT
;Send missing stop code message
S ECX=$O(^TMP($J,"ECXBCMM","ECXNOSC",0))
I ECX D
.S XMSUB="CLINICS WITH MISSING STOP CODE in File #44",XMDUZ="DSS SYSTEM"
.K XMY S XMY("G.DSS-"_ECGRP_"@"_^XMB("NETNAME"))=""
.S ECMSG(1,0)="The DSS-"_ECPACK_" extract (#"_$P(EC23,U,2)_") for "_ECSDN_" through"
.S ECMSG(2,0)=ECEDN_" contains the following clinics which have not been assigned a stop"
.S ECMSG(3,0)="code in the HOSPITAL LOCATION file (#44). The DSS-"_ECPACK
.S ECMSG(4,0)="extract records associated with these clinics have been given a default"
.S ECMSG(5,0)="Stop Code of ""PHA""."
.S ECMSG(6,0)=""
.S ECMSG(7,0)="CLIN IEN CLINIC NAME"
.S ECMSG(8,0)="-----------------------------------------"
.S ECMSG(9,0)=""
.S ECX=0
.F S ECX=$O(^TMP($J,"ECXBCMM","ECXNOSC",ECX)) Q:ECX="" S ECMSG(9+ECX,0)=^TMP($J,"ECXBCMM","ECXNOSC",ECX,0)
.S XMTEXT="ECMSG(" D ^XMD
;Send Inactive Stop Code message
S ECX=$O(^TMP($J,"ECXBCMM","ECXINVSC",0))
I ECX D
.S XMSUB="CLINICS WITH INACTIVE STOP CODE",XMDUZ="DSS SYSTEM"
.K XMY S XMY("G.DSS-"_ECGRP_"@"_^XMB("NETNAME"))=""
.S ECMSG(1,0)="The DSS-"_ECPACK_" extract (#"_$P(EC23,U,2)_") for "_ECSDN_" through"
.S ECMSG(2,0)=ECEDN_" contains the following clinics which have been assigned an"
.S ECMSG(3,0)="inactive stop code in the HOSPITAL LOCATION file (#44). The DSS-"
.S ECMSG(4,0)=ECPACK_" extract records associated with these clinics have been"
.S ECMSG(5,0)="given a default Stop Code of ""PHA""."
.S ECMSG(6,0)=""
.S ECMSG(7,0)="CLINIC IEN/NAME STOP CODE NUMBER/NAME "
.S ECMSG(8,0)="--------------------------------------------------------------------"
.S ECMSG(9,0)=""
.S ECX=0
.F S ECX=$O(^TMP($J,"ECXBCMM","ECXINVSC",ECX)) Q:ECX="" S ECMSG(9+ECX,0)=^TMP($J,"ECXBCMM","ECXINVSC",ECX,0)
.S XMTEXT="ECMSG(" D ^XMD
K ^TMP($J,"ECXBCMM")
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HECXBCM1 7026 printed Dec 13, 2024@01:52:16 Page 2
ECXBCM1 ;ALB/JAP-Bar Code Medical Administration Extract Cont. ;2/14/20 08:49
+1 ;;3.0;DSS EXTRACTS;**154,170,174,178,181,184,187**;Dec 22, 1997 ;Build 163
+2 ;
+3 ; Reference to ^XMD in ICR #10113
+4 ; Reference to ^XMB("NETNAME") in ICR #1131
+5 ; Reference to ^TMP($J) in SACC 2.3.2.5.1
+6 ; Reference to $$TSDATA^DGACT in ICR #2248
+7 ; Reference to IX1^DIK in ICR #10013
+8 ;
FILE ;file the extract record
+1 ;node0
+2 ;Sequence Number,Year Month, Extract Number (EC23)^facility (ECXFAC)^
+3 ;dfn (ECXDFN)^ssn (ECXSSN)^name (ECXPNM)^
+4 ;in/out (ECXA)^Day (ECXADT)^
+5 ;date of birth (ECDOB)^Gender (ECXSEX)^State (ECXSTATE)^County (ECXCNTY)^
+6 ;zip code (ECXZIP)^country (ECXCNTRY)^ward (ECXW)^treating specialty (ECXTSC)^
+7 ;provider (ECPRO)^provider person class (ECPROPC)^provider npi (ECPRONPI)^
+8 ;Placehold primary care provider(ECPTPR)^Placehold pc provider person class (ECCLAS)^
+9 ;Placehold primary care provider NPI (ECPTNPI)^Placehold primary care team (ECPTTM)^ordering stop code (ECXOSC)^
+10 ;NODE(1)
+11 ;place order number (RIEN)^order reference number (ECXORN)^route (ECXORT)^
+12 ;^action time (ECXATM)^component code (CCIEN)^
+13 ;component dose ordered (CCDORD)^component dose given(CCDGVN)^
+14 ;component units (CCUNIT)^component type (CCTYPE)^Action Status (ECXASTA)^
+15 ;Administration Medication (ECXAMED)^Scheduled Administration Date (ECXSCADT)^
+16 ;NODE(2)
+17 ;Scheduled Administration Time (ECXSCATM)^
+18 ;Order Schedule (ECXOS)^IV Unique ID (ECXIVID)^
+19 ;Infusion Rate (ECXIR)^Production Division Code (ECXDIV)^Drug IEN (ECXVAP)^NDC (ECVNDC)^ ;;143, changed Drug IEN var from DRG to ECXVAP
+20 ;Investigational (DEA Special Handling) (ECINV)^VA Drug Classification (ECVACL)^
+21 ;Master Patient Index (ECXMPI)^DOM, PRRTP and SAARTP Indicator (ECXDOM)^
+22 ;Observation Patient Indicator (ECXOBS)^Encounter Number (ECXENC)^Means Test (ECXMTST)^
+23 ;Eligibility (ECXELIG)^Enrollment Location (ECXENRL)^Enrollment Category (ECXCAT)^
+24 ;Enrollment Status (ECXSTAT)^Enrollment Priority (ECXPRIOR)_(ECXSBGRP)^
+25 ;User Enrollee (ECXUESTA)^
+26 ;Placehold Ethnicity(ECXETH)^Placehold Race 1(ECXRC1)^Veteran(ECXVET)^Period of Service(ECXPOS)^POW Status(ECXPST)^
+27 ;POW Location(ECXPLOC)^Radiation Status(ECXRST)^Agent Orange Status(ECXAST)^Agent Orange Location(ECXAOL)
+28 ;^Purple Heart Indicator(ECXPHI)^MST Status(ECXMST)^CNH/SH Status(ECXCNHU)^
+29 ;Head & Neck Cancer Indicator(ECXHNCI)^SHAD Status(ECXSHADI)
+30 ;NODE(3)
+31 ;Patient Type(ECXPTYPE)^
+32 ;CV Status Eligibility(ECXCVE)^CV Eligibility End Date(ECXCVEDT)^Encounter CV(ECXCVENC)^
+33 ;National Patient Record Flag(ECXNPRFI)^ERI(ECXERI)^SW Asia Conditions(ECXEST)^
+34 ;OEF/OIF(ECXOEF)^OEF/OIF Return Date(ECXOEFDT)^PATCAT(ECXPATCAT)
+35 ;Encounter SC (ECXESC)^IV Additives Cost ECXIVAC^IV Solutions Cost ECXIVSC^Drug cost ECXDRGC^Camp Lejeune Status (ECXCLST)^Encounter Camp Lejeune (ECXECL)
+36 ;Combat Service Indicator (ECXSVCI) ^ Combat Service Location (ECXSVCL)^ Vista DEA special hdlg (ECXDEA)^New MPI (ECXNMPI)^Feeder Key (ECXFDK)^Price Per Dispense Unit (ECXPPDU)^
+37 ;NODE(3) -Cont'd
+38 ;Self Identified Gender (ECXSIGI)
+39 ;
+40 ;convert specialty to PTF Code for transmission
+41 NEW ECXDATA,ECXTSC
+42 ;N ECXNMPI ;184 new field
+43 SET ECXDATA=$$TSDATA^DGACT(42.4,+ECXTS,.ECXDATA)
+44 SET ECXTSC=$GET(ECXDATA(7))
+45 NEW DA,DIK
+46 SET EC7=$ORDER(^ECX(ECFILE,999999999),-1)
SET EC7=EC7+1
+47 ;170 Fields will now be null
IF ECXLOGIC>2018
SET (ECXETH,ECXRC1,ECPTPR,ECCLAS,ECPTNPI,ECPTTM)=""
+48 ;178 Means Test field will now be null
IF ECXLOGIC>2020
SET ECXMTST=""
+49 ;I ECXLOGIC>2022 S ECXNMPI=ECXMPI,ECXMPI="" ;184 - field retired.
+50 SET ECODE(0)=EC7_U_EC23_U_ECXFAC_U_ECXDFN_U_ECXSSN_U_ECXPNM_U_ECXA_U_ECXADT
+51 SET ECODE(0)=ECODE(0)_U_ECXDOB_U_ECXSEX_U_ECXSTATE_U_ECXCNTY_U_ECXZIP_U_ECXCNTRY
+52 SET ECODE(0)=ECODE(0)_U_ECXW_U_ECXTSC_U_2_ECPRO_U_ECPROPC_U_ECPRONPI_U_ECPTPR_U_ECCLAS
+53 SET ECODE(0)=ECODE(0)_U_ECPTNPI_U_ECPTTM_U_ECXOSC_U
+54 SET ECODE(1)=RIEN_U_ECXORN_U_ECXORT_U_ECXATM_U_CCIEN_U_CCDORD_U_CCDGVN
+55 SET ECODE(1)=ECODE(1)_U_CCUNIT_U_CCTYPE_U_ECXASTA_U_ECXAMED_U_ECXSCADT_U
+56 ;143 Changed DRUG IEN field from DRG to ECXVAP
SET ECODE(2)=ECXSCATM_U_ECXOS_U_ECXIVID_U_ECXIR_U_ECXDIV_U_ECXVAP_U_ECVNDC_U_ECINV_U_ECVACL_U_ECXMPI_U_ECXDOM
+57 SET ECODE(2)=ECODE(2)_U_$EXTRACT(ECXOBS,1)_U_ECXENC_U_ECXMTST_U_ECXELIG_U_ECXENRL_U_ECXCAT_U_ECXSTAT_U_ECXPRIOR_ECXSBGRP
+58 SET ECODE(2)=ECODE(2)_U_ECXUESTA_U_ECXETH_U_ECXRC1_U_ECXVET_U_ECXPOS_U_ECXPST_U_ECXPLOC
+59 SET ECODE(2)=ECODE(2)_U_ECXRST_U_ECXAST_U_ECXAOL_U_ECXPHI_U_ECXMST_U_ECXCNHU_U_ECXHNCI_U_ECXSHADI_U
+60 SET ECODE(3)=ECXPTYPE_U_ECXCVE_U_ECXCVEDT_U_ECXCVENC_U_ECXNPRFI_U_ECXERI_U_ECXEST_U_ECXOEF_U_ECXOEFDT
+61 SET ECODE(3)=ECODE(3)_U_ECXPATCAT
+62 ;144
IF ECXLOGIC>2013
SET ECODE(3)=ECODE(3)_U_ECXESC_U_ECXIVAC_U_ECXIVSC_U_ECXDRGC_U_ECXCLST_U_ECXECL
+63 ;149
IF ECXLOGIC>2014
SET ECODE(3)=ECODE(3)_U_ECXSVCI_U_ECXSVCL
+64 ;174
IF ECXLOGIC>2019
SET ECODE(3)=ECODE(3)_U_ECXDEA
+65 ;184
IF ECXLOGIC>2022
SET ECODE(3)=ECODE(3)_U_ECXNMPI_U_ECXFDK_U_ECXPPDU_U_ECXSIGI
+66 ;187
IF ECXLOGIC>2023
SET ECODE(3)=ECODE(3)_U_ECXDUNIT
+67 ;
+68 NEW DA,DIK,X
SET X=""
+69 FOR X=0:1:3
SET ^ECX(ECFILE,EC7,X)=ECODE(X)
+70 SET ECRN=ECRN+1
+71 SET DA=EC7
SET DIK="^ECX("_ECFILE_","
DO IX1^DIK
KILL DIK,DA
+72 QUIT
+73 ;
SENDMSG ;181 - Called from ECXBCM
+1 NEW ECMSG,ECX,XMSUB,XMDUZ,XMY,XMTEXT
+2 ;Send missing stop code message
+3 SET ECX=$ORDER(^TMP($JOB,"ECXBCMM","ECXNOSC",0))
+4 IF ECX
Begin DoDot:1
+5 SET XMSUB="CLINICS WITH MISSING STOP CODE in File #44"
SET XMDUZ="DSS SYSTEM"
+6 KILL XMY
SET XMY("G.DSS-"_ECGRP_"@"_^XMB("NETNAME"))=""
+7 SET ECMSG(1,0)="The DSS-"_ECPACK_" extract (#"_$PIECE(EC23,U,2)_") for "_ECSDN_" through"
+8 SET ECMSG(2,0)=ECEDN_" contains the following clinics which have not been assigned a stop"
+9 SET ECMSG(3,0)="code in the HOSPITAL LOCATION file (#44). The DSS-"_ECPACK
+10 SET ECMSG(4,0)="extract records associated with these clinics have been given a default"
+11 SET ECMSG(5,0)="Stop Code of ""PHA""."
+12 SET ECMSG(6,0)=""
+13 SET ECMSG(7,0)="CLIN IEN CLINIC NAME"
+14 SET ECMSG(8,0)="-----------------------------------------"
+15 SET ECMSG(9,0)=""
+16 SET ECX=0
+17 FOR
SET ECX=$ORDER(^TMP($JOB,"ECXBCMM","ECXNOSC",ECX))
if ECX=""
QUIT
SET ECMSG(9+ECX,0)=^TMP($JOB,"ECXBCMM","ECXNOSC",ECX,0)
+18 SET XMTEXT="ECMSG("
DO ^XMD
End DoDot:1
+19 ;Send Inactive Stop Code message
+20 SET ECX=$ORDER(^TMP($JOB,"ECXBCMM","ECXINVSC",0))
+21 IF ECX
Begin DoDot:1
+22 SET XMSUB="CLINICS WITH INACTIVE STOP CODE"
SET XMDUZ="DSS SYSTEM"
+23 KILL XMY
SET XMY("G.DSS-"_ECGRP_"@"_^XMB("NETNAME"))=""
+24 SET ECMSG(1,0)="The DSS-"_ECPACK_" extract (#"_$PIECE(EC23,U,2)_") for "_ECSDN_" through"
+25 SET ECMSG(2,0)=ECEDN_" contains the following clinics which have been assigned an"
+26 SET ECMSG(3,0)="inactive stop code in the HOSPITAL LOCATION file (#44). The DSS-"
+27 SET ECMSG(4,0)=ECPACK_" extract records associated with these clinics have been"
+28 SET ECMSG(5,0)="given a default Stop Code of ""PHA""."
+29 SET ECMSG(6,0)=""
+30 SET ECMSG(7,0)="CLINIC IEN/NAME STOP CODE NUMBER/NAME "
+31 SET ECMSG(8,0)="--------------------------------------------------------------------"
+32 SET ECMSG(9,0)=""
+33 SET ECX=0
+34 FOR
SET ECX=$ORDER(^TMP($JOB,"ECXBCMM","ECXINVSC",ECX))
if ECX=""
QUIT
SET ECMSG(9+ECX,0)=^TMP($JOB,"ECXBCMM","ECXINVSC",ECX,0)
+35 SET XMTEXT="ECMSG("
DO ^XMD
End DoDot:1
+36 KILL ^TMP($JOB,"ECXBCMM")
+37 QUIT