ECXOPRX1 ;ALB/JAP,BIR/DMA,CML,PTD-Prescription Extract for DSS ;2/14/20 08:59
;;3.0;DSS EXTRACTS;**92,107,105,120,127,144,149,154,161,166,170,174,178,184,187**;Dec 22, 1997;Build 163
;
; Reference to $$TSDATA^DGACT in ICR #2248
;
FILE ;file record
;node0
;inst^dfn^ssn^name^in/out ECXA^day^division^provider^drug category^mail^
;placeholder1^new^shad indicator^qty^cost^PLACEHOLD encounter shad^mov #^treat spec^placeholder4^unit of issue^dob^elig^vet^copay^
;feeder key^investigational^days supply^Placehold primary care team^Placehold primary care provider^time^race
;node1
;mpi^placeholder ECXDSSD^sex^zip+4^placeholder^placeholder^state^county^Placehold pc prov person class^pow status^pow location^
;ir status^ao status^sharing agree. payor^sharing agree. ins.^mst status^enroll loc^Placehold assoc pc provider^Placehold assoc pc prov person class^
;placeholder^dom ECXDOM^purple heart ECXPHI^enrollment category ECXCAT^enrollment status ECXSTST^
;enrollment priority ECXPRIOR^cnhu status ECXCNHU^period of service ECXPOS^observ pat ind ECXOBS^encounter num ECXENC^
;ao loc ECXAOL^ord physician ECXORDPH^ord stop code ECXORDST^ord date ECXORDDT^CNH status ECXCNH^national division ECXPDIV^
;MT Stat ECXMTST^head & neck cancer ind. ECXHNCI^Placehold ethnicity ECXETH^Placehold race ECXRC1^^enrollment priority ECXPRIOR_
;enrollment subgroup ECXSBGRP^user enrollee ECXUESTA
;NODE 2
;patient type ECXPTYPE^combat vet elig ECXCVE^combat vet elig end date ECXCVEDT^
;PLACEHOLD enc cv eligible ECXCVENC^national patient record flag ECXNPRFI^rx patient status ECRXPTST^non-va prescriber ECNONVAP^rx # ECRXNUM
;^emergency response indicator(FEMA) ECXERI^PLACEHOLD agent orange enc ECXAO^PLACEHOLD environ cont PGE ECXECE^PLACEHOLD head/neck ECXHNC^PLACEHOLD enc mst ECXMIL^environ contamin ECXEST^PLACEHOLD ion radiat ECXIR
;^OEF/OIF data ECXOEF^OEFOIF return date ECXOEFDT^Placehold associate pc provider npi ECASNPI^Placehold primary care provider npi ECPTNPI^provider npi ECPRVNPI
;^country ECXCNTRY^PATCAT^PLACEHOLD Encounter SC ECXESC^Vietnam ECXVNS^Camp Lejeune Status ECXCLST^PLACEHOLD Encounter Camp Lejeune ECXECL^Combat Service Ind ECXSVCI ^Combat Service Loc ECXSVCL^Choice RX ECXCHOCE
;^ Patient Division ECXSTANO ^ Vista DEA Special Handling (ECXDEA)
;NODE 3
;Placehold CERNER ECXCERN^
;NODE4 4
;New MPI ECXNMPI^Self Identified Gender ECXSIGI^Dispense Unit ECXDUNIT^Price Per Dispense Unit ECXPPDU
N DA,DIK
S EC7=$O(^ECX(ECFILE,999999999),-1),EC7=EC7+1
I ECXLOGIC>2018 S (ECXRACE,ECXETH,ECXRC1,ECPTTM,ECPTPR,ECCLAS,ECASPR,ECCLAS2,ECASNPI,ECPTNPI)="" ;170 Fields will now be null
I ECXLOGIC>2019 S (ECXSHAD,ECXCVENC,ECXAO,ECXECE,ECXHNC,ECXMIL,ECXIR,ECXESC,ECXECL)="" ;174 Fields will now be null
I ECXLOGIC>2020 S ECXMTST="" ;178 Means Test field will now be null
I ECXLOGIC>2022 S (ECXCERN,ECXMPI)="" ;184 - field retired: MPI, New field: ECXCERN
S ECODE=EC7_U_EC23_U_ECINST_U_ECXDFN_U_ECXSSN_U_ECXPNM_U_ECXA_U
S ECODE=ECODE_$$ECXDATE^ECXUTL(ECXDATE,ECXYM)_U_ECXDIV_U
S ECODE=ECODE_ECXPROV_U_ECCAT_U_ECMW_U_ECXPROVP_U_ECXNEW_U_$S(ECXLOGIC>2010:ECXSHADI,1:"")_U_ECQTY_U
;convert specialty to PTF Code for transmission
N ECXDATA
S ECXDATA=$$TSDATA^DGACT(42.4,+ECXTS,.ECXDATA)
S ECXTS=$G(ECXDATA(7))
;done
S ECODE=ECODE_ECXCOST_U_$S(ECXLOGIC>2010:ECXSHAD,1:"")_U_ECXMN_U_ECXTS_U_U_ECUI_U_ECXDOB_U
S ECODE=ECODE_ECXELIG_U_ECXVET_U_ECOPAY_U_ECNFC_U_ECINV_U_ECDS_U
S ECODE=ECODE_ECPTTM_U_ECPTPR_U_$$ECXTIME^ECXUTL(ECXDATE)_U_ECXRACE_U
S ECODE1=ECXMPI_U_ECXDSSD_U_ECXSEX_U_ECXZIP_U_ECXPROVN_U_U
S ECODE1=ECODE1_ECXSTATE_U_ECXCNTY_U_ECCLAS_U_ECXPST_U_ECXPLOC_U
S ECODE1=ECODE1_ECXRST_U_ECXAST_U_U_U_ECXMST_U_ECXENRL_U
S ECODE1=ECODE1_ECASPR_U_ECCLAS2_U_U_ECXDOM_U_ECXPHI_U_ECXCAT_U
S ECODE1=ECODE1_ECXSTAT_U_$S(ECXLOGIC<2005:ECXPRIOR,1:"")_U_ECXCNHU_U_ECXPOS_U_ECXOBS_U
S ECODE1=ECODE1_ECXENC_U_ECXAOL_U_ECXORDPH_U_ECXORDST_U_ECXORDDT_U
S ECODE1=ECODE1_ECXCNH_U_ECXPDIV_U_ECXMTST_U_ECXHNCI_U_ECXETH_U
S ECODE1=ECODE1_ECXRC1_U
I ECXLOGIC>2004 S ECODE1=ECODE1_U_ECXPRIOR_ECXSBGRP_U_ECXUESTA_U
I ECXLOGIC>2004 S ECODE2=ECXPTYPE_U_ECXCVE_U_ECXCVEDT_U_ECXCVENC_U_ECXNPRFI_U_ECRXPTST_U_ECNONVAP
I ECXLOGIC>2005 S ECODE2=ECODE2_U_ECRXNUM
I ECXLOGIC>2006 S ECODE2=ECODE2_U_ECXERI_U_ECXAO_U_ECXECE_U_ECXHNC_U_ECXMIL_U_ECXEST_U_ECXIR_U_ECXSCRX
I ECXLOGIC>2007 S ECODE2=ECODE2_U_ECXOEF_U_ECXOEFDT_U_ECASNPI_U_ECPTNPI_U_ECPRVNPI
I ECXLOGIC>2009 S ECODE2=ECODE2_U_ECXCNTRY
I ECXLOGIC>2010 S ECODE2=ECODE2_U_ECXPATCAT
I ECXLOGIC>2013 S ECODE2=ECODE2_U_ECXESC_U_ECXVNS_U_ECXCLST_U_ECXECL ;144
I ECXLOGIC>2014 S ECODE2=ECODE2_U_ECXSVCI_U_ECXSVCL ;149
I ECXLOGIC>2015 S ECODE2=ECODE2_U_ECXCHOCE ;154
I ECXLOGIC>2017 S ECODE2=ECODE2_U_ECXSTANO ;166 tjl
I ECXLOGIC>2019 S ECODE2=ECODE2_U_ECXDEA_U ;174 ,184 Added "^"
I ECXLOGIC>2022 S ECODE3=$G(ECXCERN)_U,ECODE4=ECXNMPI_U_ECXSIGI ;184
I ECXLOGIC>2023 S ECODE4=ECODE4_U_ECXPPDU_U_ECXDUNIT ;187
S ^ECX(ECFILE,EC7,0)=ECODE,^ECX(ECFILE,EC7,1)=ECODE1,^ECX(ECFILE,EC7,2)=$G(ECODE2) ;184 - Move record count to below
S ^ECX(ECFILE,EC7,3)=$G(ECODE3),^ECX(ECFILE,EC7,4)=$G(ECODE4) ;184
S ECRN=ECRN+1 ;184 - Move record count from above
S DA=EC7,DIK="^ECX("_ECFILE_"," D IX1^DIK K DIK,DA
I $D(ZTQUEUED),$$S^%ZTLOAD S QFLG=1
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HECXOPRX1 5300 printed Oct 16, 2024@17:54:02 Page 2
ECXOPRX1 ;ALB/JAP,BIR/DMA,CML,PTD-Prescription Extract for DSS ;2/14/20 08:59
+1 ;;3.0;DSS EXTRACTS;**92,107,105,120,127,144,149,154,161,166,170,174,178,184,187**;Dec 22, 1997;Build 163
+2 ;
+3 ; Reference to $$TSDATA^DGACT in ICR #2248
+4 ;
FILE ;file record
+1 ;node0
+2 ;inst^dfn^ssn^name^in/out ECXA^day^division^provider^drug category^mail^
+3 ;placeholder1^new^shad indicator^qty^cost^PLACEHOLD encounter shad^mov #^treat spec^placeholder4^unit of issue^dob^elig^vet^copay^
+4 ;feeder key^investigational^days supply^Placehold primary care team^Placehold primary care provider^time^race
+5 ;node1
+6 ;mpi^placeholder ECXDSSD^sex^zip+4^placeholder^placeholder^state^county^Placehold pc prov person class^pow status^pow location^
+7 ;ir status^ao status^sharing agree. payor^sharing agree. ins.^mst status^enroll loc^Placehold assoc pc provider^Placehold assoc pc prov person class^
+8 ;placeholder^dom ECXDOM^purple heart ECXPHI^enrollment category ECXCAT^enrollment status ECXSTST^
+9 ;enrollment priority ECXPRIOR^cnhu status ECXCNHU^period of service ECXPOS^observ pat ind ECXOBS^encounter num ECXENC^
+10 ;ao loc ECXAOL^ord physician ECXORDPH^ord stop code ECXORDST^ord date ECXORDDT^CNH status ECXCNH^national division ECXPDIV^
+11 ;MT Stat ECXMTST^head & neck cancer ind. ECXHNCI^Placehold ethnicity ECXETH^Placehold race ECXRC1^^enrollment priority ECXPRIOR_
+12 ;enrollment subgroup ECXSBGRP^user enrollee ECXUESTA
+13 ;NODE 2
+14 ;patient type ECXPTYPE^combat vet elig ECXCVE^combat vet elig end date ECXCVEDT^
+15 ;PLACEHOLD enc cv eligible ECXCVENC^national patient record flag ECXNPRFI^rx patient status ECRXPTST^non-va prescriber ECNONVAP^rx # ECRXNUM
+16 ;^emergency response indicator(FEMA) ECXERI^PLACEHOLD agent orange enc ECXAO^PLACEHOLD environ cont PGE ECXECE^PLACEHOLD head/neck ECXHNC^PLACEHOLD enc mst ECXMIL^environ contamin ECXEST^PLACEHOLD ion radiat ECXIR
+17 ;^OEF/OIF data ECXOEF^OEFOIF return date ECXOEFDT^Placehold associate pc provider npi ECASNPI^Placehold primary care provider npi ECPTNPI^provider npi ECPRVNPI
+18 ;^country ECXCNTRY^PATCAT^PLACEHOLD Encounter SC ECXESC^Vietnam ECXVNS^Camp Lejeune Status ECXCLST^PLACEHOLD Encounter Camp Lejeune ECXECL^Combat Service Ind ECXSVCI ^Combat Service Loc ECXSVCL^Choice RX ECXCHOCE
+19 ;^ Patient Division ECXSTANO ^ Vista DEA Special Handling (ECXDEA)
+20 ;NODE 3
+21 ;Placehold CERNER ECXCERN^
+22 ;NODE4 4
+23 ;New MPI ECXNMPI^Self Identified Gender ECXSIGI^Dispense Unit ECXDUNIT^Price Per Dispense Unit ECXPPDU
+24 NEW DA,DIK
+25 SET EC7=$ORDER(^ECX(ECFILE,999999999),-1)
SET EC7=EC7+1
+26 ;170 Fields will now be null
IF ECXLOGIC>2018
SET (ECXRACE,ECXETH,ECXRC1,ECPTTM,ECPTPR,ECCLAS,ECASPR,ECCLAS2,ECASNPI,ECPTNPI)=""
+27 ;174 Fields will now be null
IF ECXLOGIC>2019
SET (ECXSHAD,ECXCVENC,ECXAO,ECXECE,ECXHNC,ECXMIL,ECXIR,ECXESC,ECXECL)=""
+28 ;178 Means Test field will now be null
IF ECXLOGIC>2020
SET ECXMTST=""
+29 ;184 - field retired: MPI, New field: ECXCERN
IF ECXLOGIC>2022
SET (ECXCERN,ECXMPI)=""
+30 SET ECODE=EC7_U_EC23_U_ECINST_U_ECXDFN_U_ECXSSN_U_ECXPNM_U_ECXA_U
+31 SET ECODE=ECODE_$$ECXDATE^ECXUTL(ECXDATE,ECXYM)_U_ECXDIV_U
+32 SET ECODE=ECODE_ECXPROV_U_ECCAT_U_ECMW_U_ECXPROVP_U_ECXNEW_U_$SELECT(ECXLOGIC>2010:ECXSHADI,1:"")_U_ECQTY_U
+33 ;convert specialty to PTF Code for transmission
+34 NEW ECXDATA
+35 SET ECXDATA=$$TSDATA^DGACT(42.4,+ECXTS,.ECXDATA)
+36 SET ECXTS=$GET(ECXDATA(7))
+37 ;done
+38 SET ECODE=ECODE_ECXCOST_U_$SELECT(ECXLOGIC>2010:ECXSHAD,1:"")_U_ECXMN_U_ECXTS_U_U_ECUI_U_ECXDOB_U
+39 SET ECODE=ECODE_ECXELIG_U_ECXVET_U_ECOPAY_U_ECNFC_U_ECINV_U_ECDS_U
+40 SET ECODE=ECODE_ECPTTM_U_ECPTPR_U_$$ECXTIME^ECXUTL(ECXDATE)_U_ECXRACE_U
+41 SET ECODE1=ECXMPI_U_ECXDSSD_U_ECXSEX_U_ECXZIP_U_ECXPROVN_U_U
+42 SET ECODE1=ECODE1_ECXSTATE_U_ECXCNTY_U_ECCLAS_U_ECXPST_U_ECXPLOC_U
+43 SET ECODE1=ECODE1_ECXRST_U_ECXAST_U_U_U_ECXMST_U_ECXENRL_U
+44 SET ECODE1=ECODE1_ECASPR_U_ECCLAS2_U_U_ECXDOM_U_ECXPHI_U_ECXCAT_U
+45 SET ECODE1=ECODE1_ECXSTAT_U_$SELECT(ECXLOGIC<2005:ECXPRIOR,1:"")_U_ECXCNHU_U_ECXPOS_U_ECXOBS_U
+46 SET ECODE1=ECODE1_ECXENC_U_ECXAOL_U_ECXORDPH_U_ECXORDST_U_ECXORDDT_U
+47 SET ECODE1=ECODE1_ECXCNH_U_ECXPDIV_U_ECXMTST_U_ECXHNCI_U_ECXETH_U
+48 SET ECODE1=ECODE1_ECXRC1_U
+49 IF ECXLOGIC>2004
SET ECODE1=ECODE1_U_ECXPRIOR_ECXSBGRP_U_ECXUESTA_U
+50 IF ECXLOGIC>2004
SET ECODE2=ECXPTYPE_U_ECXCVE_U_ECXCVEDT_U_ECXCVENC_U_ECXNPRFI_U_ECRXPTST_U_ECNONVAP
+51 IF ECXLOGIC>2005
SET ECODE2=ECODE2_U_ECRXNUM
+52 IF ECXLOGIC>2006
SET ECODE2=ECODE2_U_ECXERI_U_ECXAO_U_ECXECE_U_ECXHNC_U_ECXMIL_U_ECXEST_U_ECXIR_U_ECXSCRX
+53 IF ECXLOGIC>2007
SET ECODE2=ECODE2_U_ECXOEF_U_ECXOEFDT_U_ECASNPI_U_ECPTNPI_U_ECPRVNPI
+54 IF ECXLOGIC>2009
SET ECODE2=ECODE2_U_ECXCNTRY
+55 IF ECXLOGIC>2010
SET ECODE2=ECODE2_U_ECXPATCAT
+56 ;144
IF ECXLOGIC>2013
SET ECODE2=ECODE2_U_ECXESC_U_ECXVNS_U_ECXCLST_U_ECXECL
+57 ;149
IF ECXLOGIC>2014
SET ECODE2=ECODE2_U_ECXSVCI_U_ECXSVCL
+58 ;154
IF ECXLOGIC>2015
SET ECODE2=ECODE2_U_ECXCHOCE
+59 ;166 tjl
IF ECXLOGIC>2017
SET ECODE2=ECODE2_U_ECXSTANO
+60 ;174 ,184 Added "^"
IF ECXLOGIC>2019
SET ECODE2=ECODE2_U_ECXDEA_U
+61 ;184
IF ECXLOGIC>2022
SET ECODE3=$GET(ECXCERN)_U
SET ECODE4=ECXNMPI_U_ECXSIGI
+62 ;187
IF ECXLOGIC>2023
SET ECODE4=ECODE4_U_ECXPPDU_U_ECXDUNIT
+63 ;184 - Move record count to below
SET ^ECX(ECFILE,EC7,0)=ECODE
SET ^ECX(ECFILE,EC7,1)=ECODE1
SET ^ECX(ECFILE,EC7,2)=$GET(ECODE2)
+64 ;184
SET ^ECX(ECFILE,EC7,3)=$GET(ECODE3)
SET ^ECX(ECFILE,EC7,4)=$GET(ECODE4)
+65 ;184 - Move record count from above
SET ECRN=ECRN+1
+66 SET DA=EC7
SET DIK="^ECX("_ECFILE_","
DO IX1^DIK
KILL DIK,DA
+67 IF $DATA(ZTQUEUED)
IF $$S^%ZTLOAD
SET QFLG=1
+68 QUIT