ECXTRT2 ;ALB/JAP,BIR/DMA,CML,PTD-Treating Specialty Change Extract ;4/17/17 11:04
;;3.0;DSS EXTRACTS;**105,127,161,166,184**;Dec 22, 1997;Build 124
;
FILE ;file the extract record
;node0
;^dfn^facility^ssn^name^i/o (ECXA)^date^product^adm date^d/c date^ ;166 tjl - store the FACILITY, starting in FY18
;mov#^type^new ts^losing ts^losing ts los^
;losing attending^movement type^time^adm time^new provider^
;new attending^losing provider
;node1
;mpi^placeholder^placeholder^placeholder^placeholder^
;placeholder^losing attending los^losing provider los^dom^
;observ pat ind^encounter num
;^losing attending physician npi^losing prim ward provider npi^
;new attending physician npi^new primary ward provider npi
;^product division code^losing attending physician PC^new primary ward
;provider pc^new attending physician pc^losing primary ward prov pc^
;new attending physician npi^new primary ward provider npi^PATCAT^
;node2 ;184
;CERNER Data (ECXCERN)^
;node 3 ;184
;New MPI (ECXNMPI)^Self Identified Gender (ECSIGI)
;
;convert specialties to PTF Codes for transmission
;
N ECXDATA
S ECXDATA=$$TSDATA^DGACT(42.4,+ECXSPCN,.ECXDATA)
S ECXSPCN=$G(ECXDATA(7))
S ECXDATA=$$TSDATA^DGACT(42.4,+ECXSPCL,.ECXDATA)
S ECXSPCL=$G(ECXDATA(7))
;done
S EC7=$O(^ECX(ECFILE,999999999),-1),EC7=EC7+1
S ECODE=EC7_U_EC23_U_U_ECXDFN_U_ECXSSN_U_ECXPNM_U_ECXA_U_ECXDATE_U_U
I ECXLOGIC>2017 S $P(ECODE,U,4)=ECXPDIV ;166 tjl - Store the Production Division Code in the Facility field
I ECXLOGIC>2022 S ECXMPI="" ;184 - Field retired
S ECODE=ECODE_ECXADMDT_U_ECXDCDT_U_ECDA_U_6_U_ECXSPCN_U_ECXSPCL_U
S ECODE=ECODE_ECXLOS_U_ECXATTL_U_ECMT_U_ECXTIME_U_ECXADMTM_U_ECXPRVN_U
S ECODE=ECODE_ECXATTN_U_ECXPRVL_U
S ECODE1=ECXMPI_U_ECXDSSD_U_U_U_U_U
S ECODE1=ECODE1_ECXLOSA_U_ECXLOSP_U_ECXDOM_U_ECXOBS_U_ECXENC_U_ECXPDIV
I ECXLOGIC>2005 S ECODE1=ECODE1_U_ECXATLPC_U_ECXPRNPC_U_ECXATNPC_U_ECXPRLPC
I ECXLOGIC>2007 S ECODE1=ECODE1_U_ECATLNPI_U_ECPRLNPI_U_ECATTNPI_U_ECPRVNPI
I ECXLOGIC>2010 S ECODE1=ECODE1_U_ECXPATCAT_U ;184 Added "^"
I ECXLOGIC>2022 S ECODE2=$G(ECXCERN)_U,ECODE3=ECXNMPI_U_ECXSIGI ;184
S ^ECX(ECFILE,EC7,0)=ECODE,^ECX(ECFILE,EC7,1)=ECODE1 ; ,ECRN=ECRN+1 184 - Moved record count to below
S ^ECX(ECFILE,EC7,2)=$G(ECODE2),^ECX(ECFILE,EC7,3)=$G(ECODE3) ;184
S ECRN=ECRN+1 ;184 - Moved 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
;
SETUP ;Set required input for ECXTRAC
S ECHEAD="TRT"
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[HECXTRT2 2724 printed Oct 16, 2024@17:54:55 Page 2
ECXTRT2 ;ALB/JAP,BIR/DMA,CML,PTD-Treating Specialty Change Extract ;4/17/17 11:04
+1 ;;3.0;DSS EXTRACTS;**105,127,161,166,184**;Dec 22, 1997;Build 124
+2 ;
FILE ;file the extract record
+1 ;node0
+2 ;^dfn^facility^ssn^name^i/o (ECXA)^date^product^adm date^d/c date^ ;166 tjl - store the FACILITY, starting in FY18
+3 ;mov#^type^new ts^losing ts^losing ts los^
+4 ;losing attending^movement type^time^adm time^new provider^
+5 ;new attending^losing provider
+6 ;node1
+7 ;mpi^placeholder^placeholder^placeholder^placeholder^
+8 ;placeholder^losing attending los^losing provider los^dom^
+9 ;observ pat ind^encounter num
+10 ;^losing attending physician npi^losing prim ward provider npi^
+11 ;new attending physician npi^new primary ward provider npi
+12 ;^product division code^losing attending physician PC^new primary ward
+13 ;provider pc^new attending physician pc^losing primary ward prov pc^
+14 ;new attending physician npi^new primary ward provider npi^PATCAT^
+15 ;node2 ;184
+16 ;CERNER Data (ECXCERN)^
+17 ;node 3 ;184
+18 ;New MPI (ECXNMPI)^Self Identified Gender (ECSIGI)
+19 ;
+20 ;convert specialties to PTF Codes for transmission
+21 ;
+22 NEW ECXDATA
+23 SET ECXDATA=$$TSDATA^DGACT(42.4,+ECXSPCN,.ECXDATA)
+24 SET ECXSPCN=$GET(ECXDATA(7))
+25 SET ECXDATA=$$TSDATA^DGACT(42.4,+ECXSPCL,.ECXDATA)
+26 SET ECXSPCL=$GET(ECXDATA(7))
+27 ;done
+28 SET EC7=$ORDER(^ECX(ECFILE,999999999),-1)
SET EC7=EC7+1
+29 SET ECODE=EC7_U_EC23_U_U_ECXDFN_U_ECXSSN_U_ECXPNM_U_ECXA_U_ECXDATE_U_U
+30 ;166 tjl - Store the Production Division Code in the Facility field
IF ECXLOGIC>2017
SET $PIECE(ECODE,U,4)=ECXPDIV
+31 ;184 - Field retired
IF ECXLOGIC>2022
SET ECXMPI=""
+32 SET ECODE=ECODE_ECXADMDT_U_ECXDCDT_U_ECDA_U_6_U_ECXSPCN_U_ECXSPCL_U
+33 SET ECODE=ECODE_ECXLOS_U_ECXATTL_U_ECMT_U_ECXTIME_U_ECXADMTM_U_ECXPRVN_U
+34 SET ECODE=ECODE_ECXATTN_U_ECXPRVL_U
+35 SET ECODE1=ECXMPI_U_ECXDSSD_U_U_U_U_U
+36 SET ECODE1=ECODE1_ECXLOSA_U_ECXLOSP_U_ECXDOM_U_ECXOBS_U_ECXENC_U_ECXPDIV
+37 IF ECXLOGIC>2005
SET ECODE1=ECODE1_U_ECXATLPC_U_ECXPRNPC_U_ECXATNPC_U_ECXPRLPC
+38 IF ECXLOGIC>2007
SET ECODE1=ECODE1_U_ECATLNPI_U_ECPRLNPI_U_ECATTNPI_U_ECPRVNPI
+39 ;184 Added "^"
IF ECXLOGIC>2010
SET ECODE1=ECODE1_U_ECXPATCAT_U
+40 ;184
IF ECXLOGIC>2022
SET ECODE2=$GET(ECXCERN)_U
SET ECODE3=ECXNMPI_U_ECXSIGI
+41 ; ,ECRN=ECRN+1 184 - Moved record count to below
SET ^ECX(ECFILE,EC7,0)=ECODE
SET ^ECX(ECFILE,EC7,1)=ECODE1
+42 ;184
SET ^ECX(ECFILE,EC7,2)=$GET(ECODE2)
SET ^ECX(ECFILE,EC7,3)=$GET(ECODE3)
+43 ;184 - Moved record count from above
SET ECRN=ECRN+1
+44 SET DA=EC7
SET DIK="^ECX("_ECFILE_","
DO IX1^DIK
KILL DIK,DA
+45 IF $DATA(ZTQUEUED)
IF $$S^%ZTLOAD
SET QFLG=1
+46 QUIT
+47 ;
SETUP ;Set required input for ECXTRAC
+1 SET ECHEAD="TRT"
+2 DO ECXDEF^ECXUTL2(ECHEAD,.ECPACK,.ECGRP,.ECFILE,.ECRTN,.ECPIECE,.ECVER)
+3 QUIT
+4 ;
QUE ; entry point for the background requeuing handled by ECXTAUTO
+1 DO SETUP
DO QUE^ECXTAUTO
DO ^ECXKILL
+2 QUIT