ECXQSR1 ;ALB/JAP,BIR/PTD-DSS QUASAR Extract ;4/24/18 14:06
;;3.0;DSS EXTRACTS;**105,120,127,132,136,144,149,154,161,166,170**;Dec 22, 1997;Build 12
FILE ;file record in #727.825
;node0
;inst^dfn ECXDFN^ssn ECXSSN^name ECXPNM^i/o status ECXA^day ECDAY^
;DSS unit ECDU^^category ECPTTM^procedure ECP^volume ECV^cost center^
;ordering sec ^section^provider ECXPRV1^ECXPPC1^ECXPRV2^ECXPPC2^ECXPRV3^
;ECXPPC3^mov # ECXMN^treat spec ECXTS^time ECTIME^Placehold primary care team
;ECPTTM^Placehold primary care provider ECPTPR^pce cpt code & modifers ECXCPT^
;Placeholder ECDIA^Placeholder ECXICD91^Placeholder ECXICD92^
;Placeholder ECXICD93^Placeholder ECXICD94^
;agent orange ECXAST^radiation exposure ECRST^environmental
;contaminants ECEST^service connected ECSC^sent to pce^^dss identifier
;ECDSS^placeholder
;node1
;mpi ECXNPI^placeholder ECXDSSD^^^Placehold PC provider person class^placeholder
;^Placehold assoc pc provider ECASPR^Placehold assoc pc prov person class
;ECCLAS2^placeholder^divison ECXDIV^dom ECXDOM^
;enrollment category ECXCAT^enrollment status ECXSTAT^enrollment prior
;ECXPRIOR^period of service ECXPOS^purple heart ECXPHI^observ pat ind
;ECXOBS^encounter num ECXENC^ao loc ECXAOL^ord div ECXODIV^contr st dt
;ECXCSDT^contr end dt ECXCEDT^contr typ ECXCTYP^CNH stat ECXCNH^
;production division ECXPDIV^eligibility ECXELIG^Placehold ethnicity ECXETH^
;Placehold race1 ECXRC1^enrollment location ECXENRL^^enrollment priority
;ECXPRIOR_enrollment subgroup ECXSBGRP^user enrollee ECXUESTA^patient
;type ECXPTYPE^combat vet elig ECXCVE
;NODE 2
;^combat vet elig end date ECXCVEDT^
;enc cv eligible ECXCVENC^national patient record flag ECXNPRFI^
;emergency response indicator(FEMA) ECXERI^agent orange indicator
;ECXAO^environ contam ECXECE^head/neck ECXHNC^military sexual trauma
;ECXMIL^radiation encoun ECXIR^nutrition dx(currently null)^OEF/OIF ECXOEF^
;OEF/OIF return date ECXOEFDT^Placehold assoc pc provider npi ECASNPI^
;Placehold primary care provider npi ECPTNPI^provider npi ECPR1NPI^
;provider #2 npi ECPR2NPI^provider #3 npi ECPR3NPI^shad status ECXSHADI^
;shad encouter ECXSHAD^pat cat ECXPATCAT^provider #4 ECXPRV4^
;provider #4 pc ECXPPC4^provider #4 npi ECPR4NPI^provider #5 ECXPRV5^
;provider #5 pc ECXPPC5^provider #5 npi ECPR5NPI^
;primary ICD-10 code ECXICD10P^Secondary ICD-10 Code #1 ECXICD101^
;Secondary ICD-10 Code #2 ECXICD102^Secondary ICD-10 Code #3 ECXICD103^
;NODE 3
;Secondary ICD-10 Code #4 ECXICD104^Encounter SC ECXESC^Vietnam Status ECXVNS
;Provider #6 ECXPRV6^ Prov #6 PC ECXPPC6^Prov #6 NPI ECPR6NPI^Provider #7 ECXPRV7^ Prov #7 PC ECXPPC7^Prov #7 NPI ECPR7NPI^4CHAR ECX4CHAR^Clinic IEN ECAC (NOW NULL)^Camp Lejeune status ECXCLST^Encounter Camp Lejeune ECXECL
;Combat Service Indicator (ECXSVCI) ^ Combat Service Location (ECXSVCL)
;Clinic IEN ECAC
;^ Patient Division (ECXSTANO) 166
;convert specialty to PTF Code for transmission
N ECXDATA,ECXTSC
N ECXRES1,ECXRES2,ECXRES3,ECXSVCI,ECXSVCL ;149
S (ECXRES1,ECXRES2,ECXRES3,ECXSVCI,ECXSVCL)="" ;149
S ECXDATA=$$TSDATA^DGACT(42.4,+ECXTS,.ECXDATA)
S ECXTSC=$G(ECXDATA(7))
;done
N DA,DIK
S EC7=$O(^ECX(ECFILE,999999999),-1),EC7=EC7+1
I ECXLOGIC>2018 S (ECXETH,ECXRC1,ECPTTM,ECPTPR,ECCLAS,ECASPR,ECCLAS2,ECASNPI,ECPTNPI)="" ;170 Fields will now be null
S ECODE=EC7_U_EC23_U
S ECODE=ECODE_ECL_U_ECXDFN_U_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ECPR1NPI)_U_$G(ECPR2NPI)_U_$G(ECPR3NPI)
I ECXLOGIC>2010 S ECODE2=ECODE2_U_$G(ECXSHADI)_U_$G(ECXSHAD)_U_ECXPATCAT
I ECXLOGIC>2011 S ECODE2=ECODE2_U_$G(ECXPRV4)_U_$G(ECXPPC4)_U_$G(ECPR4NPI)_U_$G(ECXPRV5)_U_$G(ECXPPC5)_U_$G(ECPR5NPI)
I ECXLOGIC>2012 S ECODE2=ECODE2_U_ECXICD10P_U_ECXICD101_U_ECXICD102_U_ECXICD103_U
I ECXLOGIC>2012 S ECODE3=ECXICD104
I ECXLOGIC>2013 S ECODE3=ECODE3_U_ECXESC_U_ECXVNS_U_ECXPRV6_U_ECXPPC6_U_ECPR6NPI_U_ECXPRV7_U_ECXPPC7_U_ECPR7NPI_U_ECX4CHAR_U_$S(ECXLOGIC>2015:"",1:ECAC)_U_ECXCLST_U_ECXECL ;144
I ECXLOGIC>2014 S ECODE3=ECODE3_U_ECXRES1_U_ECXRES2_U_ECXRES3_U_ECXSVCI_U_ECXSVCL ;149
I ECXLOGIC>2015 S ECODE3=ECODE3_U_ECAC ;154 MOVED CLINIC IEN
I ECXLOGIC>2017 S ECODE3=ECODE3_U_ECXSTANO ;166
S ^ECX(ECFILE,EC7,0)=ECODE,^ECX(ECFILE,EC7,1)=ECODE1,^ECX(ECFILE,EC7,2)=$G(ECODE2),^ECX(ECFILE,EC7,3)=$G(ECODE3),ECRN=ECRN+1
S DA=EC7,DIK="^ECX("_ECFILE_"," D IX1^DIK K DIK,DA
I $D(ZTQUEUED),$$S^%ZTLOAD
Q
SETUP ;Set required input for ECXTRAC
S ECHEAD="ECQ"
D ECXDEF^ECXUTL2(ECHEAD,.ECPACK,.ECGRP,.ECFILE,.ECRTN,.ECPIECE,.ECVER)
Q
QUE ;Entry point for the background requeuing handled by ECXTAUTO.
D SETUP,QUE^ECXTAUTO,^ECXKILL Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HECXQSR1 5764 printed Oct 16, 2024@17:54:27 Page 2
ECXQSR1 ;ALB/JAP,BIR/PTD-DSS QUASAR Extract ;4/24/18 14:06
+1 ;;3.0;DSS EXTRACTS;**105,120,127,132,136,144,149,154,161,166,170**;Dec 22, 1997;Build 12
FILE ;file record in #727.825
+1 ;node0
+2 ;inst^dfn ECXDFN^ssn ECXSSN^name ECXPNM^i/o status ECXA^day ECDAY^
+3 ;DSS unit ECDU^^category ECPTTM^procedure ECP^volume ECV^cost center^
+4 ;ordering sec ^section^provider ECXPRV1^ECXPPC1^ECXPRV2^ECXPPC2^ECXPRV3^
+5 ;ECXPPC3^mov # ECXMN^treat spec ECXTS^time ECTIME^Placehold primary care team
+6 ;ECPTTM^Placehold primary care provider ECPTPR^pce cpt code & modifers ECXCPT^
+7 ;Placeholder ECDIA^Placeholder ECXICD91^Placeholder ECXICD92^
+8 ;Placeholder ECXICD93^Placeholder ECXICD94^
+9 ;agent orange ECXAST^radiation exposure ECRST^environmental
+10 ;contaminants ECEST^service connected ECSC^sent to pce^^dss identifier
+11 ;ECDSS^placeholder
+12 ;node1
+13 ;mpi ECXNPI^placeholder ECXDSSD^^^Placehold PC provider person class^placeholder
+14 ;^Placehold assoc pc provider ECASPR^Placehold assoc pc prov person class
+15 ;ECCLAS2^placeholder^divison ECXDIV^dom ECXDOM^
+16 ;enrollment category ECXCAT^enrollment status ECXSTAT^enrollment prior
+17 ;ECXPRIOR^period of service ECXPOS^purple heart ECXPHI^observ pat ind
+18 ;ECXOBS^encounter num ECXENC^ao loc ECXAOL^ord div ECXODIV^contr st dt
+19 ;ECXCSDT^contr end dt ECXCEDT^contr typ ECXCTYP^CNH stat ECXCNH^
+20 ;production division ECXPDIV^eligibility ECXELIG^Placehold ethnicity ECXETH^
+21 ;Placehold race1 ECXRC1^enrollment location ECXENRL^^enrollment priority
+22 ;ECXPRIOR_enrollment subgroup ECXSBGRP^user enrollee ECXUESTA^patient
+23 ;type ECXPTYPE^combat vet elig ECXCVE
+24 ;NODE 2
+25 ;^combat vet elig end date ECXCVEDT^
+26 ;enc cv eligible ECXCVENC^national patient record flag ECXNPRFI^
+27 ;emergency response indicator(FEMA) ECXERI^agent orange indicator
+28 ;ECXAO^environ contam ECXECE^head/neck ECXHNC^military sexual trauma
+29 ;ECXMIL^radiation encoun ECXIR^nutrition dx(currently null)^OEF/OIF ECXOEF^
+30 ;OEF/OIF return date ECXOEFDT^Placehold assoc pc provider npi ECASNPI^
+31 ;Placehold primary care provider npi ECPTNPI^provider npi ECPR1NPI^
+32 ;provider #2 npi ECPR2NPI^provider #3 npi ECPR3NPI^shad status ECXSHADI^
+33 ;shad encouter ECXSHAD^pat cat ECXPATCAT^provider #4 ECXPRV4^
+34 ;provider #4 pc ECXPPC4^provider #4 npi ECPR4NPI^provider #5 ECXPRV5^
+35 ;provider #5 pc ECXPPC5^provider #5 npi ECPR5NPI^
+36 ;primary ICD-10 code ECXICD10P^Secondary ICD-10 Code #1 ECXICD101^
+37 ;Secondary ICD-10 Code #2 ECXICD102^Secondary ICD-10 Code #3 ECXICD103^
+38 ;NODE 3
+39 ;Secondary ICD-10 Code #4 ECXICD104^Encounter SC ECXESC^Vietnam Status ECXVNS
+40 ;Provider #6 ECXPRV6^ Prov #6 PC ECXPPC6^Prov #6 NPI ECPR6NPI^Provider #7 ECXPRV7^ Prov #7 PC ECXPPC7^Prov #7 NPI ECPR7NPI^4CHAR ECX4CHAR^Clinic IEN ECAC (NOW NULL)^Camp Lejeune status ECXCLST^Encounter Camp Lejeune ECXECL
+41 ;Combat Service Indicator (ECXSVCI) ^ Combat Service Location (ECXSVCL)
+42 ;Clinic IEN ECAC
+43 ;^ Patient Division (ECXSTANO) 166
+44 ;convert specialty to PTF Code for transmission
+45 NEW ECXDATA,ECXTSC
+46 ;149
NEW ECXRES1,ECXRES2,ECXRES3,ECXSVCI,ECXSVCL
+47 ;149
SET (ECXRES1,ECXRES2,ECXRES3,ECXSVCI,ECXSVCL)=""
+48 SET ECXDATA=$$TSDATA^DGACT(42.4,+ECXTS,.ECXDATA)
+49 SET ECXTSC=$GET(ECXDATA(7))
+50 ;done
+51 NEW DA,DIK
+52 SET EC7=$ORDER(^ECX(ECFILE,999999999),-1)
SET EC7=EC7+1
+53 ;170 Fields will now be null
IF ECXLOGIC>2018
SET (ECXETH,ECXRC1,ECPTTM,ECPTPR,ECCLAS,ECASPR,ECCLAS2,ECASNPI,ECPTNPI)=""
+54 SET ECODE=EC7_U_EC23_U
+55 SET ECODE=ECODE_ECL_U_ECXDFN_U_ECXSSN_U_ECXPNM_U_ECXA_U_ECDAY_U_ECDU_U_U
+56 SET ECODE=ECODE_ECP_U_ECV_U_ECCS_U_ECO_U_ECM_U_ECXPRV1_U_ECXPPC1_U
+57 SET ECODE=ECODE_ECXPRV2_U_ECXPPC2_U_ECXPRV3_U_ECXPPC3_U_U
+58 SET ECODE=ECODE_ECXMN_U_ECXTSC_U_ECTIME_U_ECPTTM_U
+59 SET ECODE=ECODE_ECPTPR_U_ECXCPT_U_ECDIA_U_ECXICD91_U_ECXICD92_U
+60 SET ECODE=ECODE_ECXICD93_U_ECXICD94_U_ECXAST_U_ECXRST_U_ECXEST_U
+61 SET ECODE=ECODE_ECSC_U_"N"_U_U_ECDSS_U_U
+62 SET ECODE1=ECXMPI_U_ECXDSSD_U_U_U_U_ECCLAS_U_U_ECASPR_U
+63 SET ECODE1=ECODE1_ECCLAS2_U_U_ECXDIV_U_ECXMST_U_ECXDOM_U
+64 SET ECODE1=ECODE1_ECXDOB_U_ECXCAT_U_ECXSTAT_U_$SELECT(ECXLOGIC<2005:ECXPRIOR,1:"")_U_ECXPOS_U_ECXPHI_U
+65 SET ECODE1=ECODE1_ECXOBS_U_ECXENC_U_ECXAOL_U_ECXODIV_U_ECXCSDT_U_ECXCEDT_U
+66 SET ECODE1=ECODE1_ECXCTYP_U_ECXCNH_U_ECXPDIV_U_ECXELIG_U_ECXHNCI_U_ECXETH_U
+67 SET ECODE1=ECODE1_ECXRC1
+68 IF ECXLOGIC>2003
SET ECODE1=ECODE1_U_ECXENRL
+69 IF ECXLOGIC>2004
SET ECODE1=ECODE1_U_U_ECXPRIOR_ECXSBGRP_U_ECXUESTA_U_ECXPTYPE_U_ECXCVE_U
+70 IF ECXLOGIC>2004
SET ECODE2=ECXCVEDT_U_ECXCVENC_U_ECXNPRFI
+71 IF ECXLOGIC>2006
SET ECODE2=ECODE2_U_ECXERI_U_ECXAO_U_ECXECE_U_ECXHNC_U_ECXMIL_U_ECXIR_U
+72 IF ECXLOGIC>2007
SET ECODE2=ECODE2_U_$GET(ECXOEF)_U_$GET(ECXOEFDT)_U_$GET(ECASNPI)_U_$GET(ECPTNPI)_U_$GET(ECPR1NPI)_U_$GET(ECPR2NPI)_U_$GET(ECPR3NPI)
+73 IF ECXLOGIC>2010
SET ECODE2=ECODE2_U_$GET(ECXSHADI)_U_$GET(ECXSHAD)_U_ECXPATCAT
+74 IF ECXLOGIC>2011
SET ECODE2=ECODE2_U_$GET(ECXPRV4)_U_$GET(ECXPPC4)_U_$GET(ECPR4NPI)_U_$GET(ECXPRV5)_U_$GET(ECXPPC5)_U_$GET(ECPR5NPI)
+75 IF ECXLOGIC>2012
SET ECODE2=ECODE2_U_ECXICD10P_U_ECXICD101_U_ECXICD102_U_ECXICD103_U
+76 IF ECXLOGIC>2012
SET ECODE3=ECXICD104
+77 ;144
IF ECXLOGIC>2013
SET ECODE3=ECODE3_U_ECXESC_U_ECXVNS_U_ECXPRV6_U_ECXPPC6_U_ECPR6NPI_U_ECXPRV7_U_ECXPPC7_U_ECPR7NPI_U_ECX4CHAR_U_$SELECT(ECXLOGIC>2015:"",1:ECAC)_U_ECXCLST_U_ECXECL
+78 ;149
IF ECXLOGIC>2014
SET ECODE3=ECODE3_U_ECXRES1_U_ECXRES2_U_ECXRES3_U_ECXSVCI_U_ECXSVCL
+79 ;154 MOVED CLINIC IEN
IF ECXLOGIC>2015
SET ECODE3=ECODE3_U_ECAC
+80 ;166
IF ECXLOGIC>2017
SET ECODE3=ECODE3_U_ECXSTANO
+81 SET ^ECX(ECFILE,EC7,0)=ECODE
SET ^ECX(ECFILE,EC7,1)=ECODE1
SET ^ECX(ECFILE,EC7,2)=$GET(ECODE2)
SET ^ECX(ECFILE,EC7,3)=$GET(ECODE3)
SET ECRN=ECRN+1
+82 SET DA=EC7
SET DIK="^ECX("_ECFILE_","
DO IX1^DIK
KILL DIK,DA
+83 IF $DATA(ZTQUEUED)
IF $$S^%ZTLOAD
+84 QUIT
SETUP ;Set required input for ECXTRAC
+1 SET ECHEAD="ECQ"
+2 DO ECXDEF^ECXUTL2(ECHEAD,.ECPACK,.ECGRP,.ECFILE,.ECRTN,.ECPIECE,.ECVER)
+3 QUIT
QUE ;Entry point for the background requeuing handled by ECXTAUTO.
+1 DO SETUP
DO QUE^ECXTAUTO
DO ^ECXKILL
QUIT