source: WorldVistAEHR/trunk/r/DSS_EXTRACTS-ECX/ECXSURG1.m@ 1204

Last change on this file since 1204 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 4.1 KB
RevLine 
[613]1ECXSURG1 ;ALB/JA,BIR/DMA,PTD-Surgery Extract for DSS ; 10/24/07 2:22pm
2 ;;3.0;DSS EXTRACTS;**105**;Dec 22, 1997;Build 70
3 ;
4FILE ;file record
5 ;node0
6 ;division^dfn^ssn^name^in/out (ECXA)^day^case #^
7 ;surg specialty^or room #^
8 ;surgeon^attending^anesthesia supervisor^anesthesia technique^
9 ;primary/secondary/prostheses^cpt^^pt time^op time^anes time^
10 ;prostheses^qty^^
11 ;movement number^treating specialty^cancel/abort (ECCAN)^time^or type^
12 ;attending's service^non-or dss id^recovery room time^^
13 ;primary care team^primary care provider^admission date
14 ;node1
15 ;mpi^dss dept ECXDSSD^surgeon npi^attending npi^anes supervisor npi^
16 ;pc provider npi^pc prov person class^
17 ;assoc pc provider^assoc pc prov person class^assoc pc prov npi^
18 ;cpt&modifiers ECXCPT^dom ECXDOM^enrollment category ECXCAT^
19 ;enrollment status ECXSTAT^enrollment priority ECXPRIOR^
20 ;period of service ECXPOS^purple heart indicator ECXPHI^
21 ;observ pat ind ECXOBS^encounter num ECXENC^ao loc ECXAOL^
22 ;production division ECXPDIV^head & neck canc ind ECXHNCI^
23 ;ethnicity ECXETH^race1 ECXRC1^new quantity ECXQ^
24 ;^user enrollee ECXUESTA^patient type ECXPTYPE^combat vet elig
25 ;ECXCVE^combat vet elig end date ECXCVEDT^enc cv eligible ECXCVENC
26 ;or clean time ECXORCT^time pt in hold area ECXPTHA^national patient
27 ;record flag ECXNPRFI^princ anesthetist ECXPA^surgeon per class ECSRPC
28 ;node2
29 ;atten surgeon per class ECATPC^anesthesia super person class ECSAPC^
30 ;princ anesthetist PC ECXPAPC^emergency response indicator(FEMA) ECXERI^
31 ;agent orange indic ECXAO^head/neck cancer ECXHNC
32 ;OEF/OIF ECXOEF^OEF/OIF return date ECXOEFDT^clinic pointer ECXCLIN
33 ;credit stop ECXCRST^stop code ECXSTCD^princ postop diagnosis code
34 ;ECXPODX^other postop diagnosis code #1 ECXPODX1^other postop
35 ;diagnosis code #2 ECXPODX2^ other postop diag code #3 ECXPODX3^
36 ;other postop diag code #4 ECXPODX4^other postop diag code #5
37 ;ECXPODX5^anesthesia sup npi ECSANPI^assoc pc prov npi ECASNPI^
38 ;attending surgeon npi ECATNPI^primary care provider npi ECPTNPI^
39 ;principle anesthetist npi ECPANPI^surgeon npi ECSRNPI
40 ;
41 N DA,DIK,STR
42 S EC7=$O(^ECX(ECFILE,999999999),-1),EC7=EC7+1
43 S ECODE=EC7_U_EC23_U_ECXDIV_U_ECXDFN_U_ECXSSN_U_ECXPNM_U_ECXA_U
44 S ECODE=ECODE_$$ECXDATE^ECXUTL(ECXDATE,ECXYM)_U_ECD0_U_ECSS_U_ECO_U
45 S ECODE=ECODE_ECSR_U_ECAT_U_ECSA_U_ECANE_U_ECODE0_U
46 S STR=ECXMN_U_ECXTS_U_$S(ECCAN'="":ECCAN,1:"")_U_ECXTM_U_ECORTY_U
47 S STR=STR_ECATSV_U_ECNL_U_ECRR_U_U_ECPTTM_U_ECPTPR_U_ECXADD_U
48 S $P(ECODE,U,26,38)=STR
49 S ECODE1=ECXMPI_U_ECXDSSD_U_U_U_U_U
50 S ECODE1=ECODE1_ECCLAS_U_ECASPR_U_ECCLAS2_U_U_ECXCPT_U_ECXDOM_U
51 S ECODE1=ECODE1_ECXCAT_U_ECXSTAT_U_$S(ECXLOGIC<2005:ECXPRIOR,1:"")_U_ECXPOS_U_ECXPHI_U
52 S ECODE1=ECODE1_ECXOBS_U_ECXENC_U_ECXAOL_U_ECXPDIV_U_ECXHNCI_U
53 S ECODE1=ECODE1_ECXETH_U_ECXRC1_U_ECXQ_U
54 I ECXLOGIC>2004 S ECODE1=ECODE1_U_ECXPRIOR_ECXSBGRP_U_ECXUESTA_U_ECXPTYPE_U_ECXCVE_U_ECXCVEDT_U_ECXCVENC_U_ECXORCT_U_ECXPTHA_U_ECXNPRFI
55 I ECXLOGIC>2005 S ECODE1=ECODE1_U_ECXPA_U_ECSRPC_U,ECODE2=ECATPC_U_ECSAPC_U_ECXPAPC
56 I ECXLOGIC>2006 S ECODE2=ECODE2_U_ECXERI_U_ECXAO_U_ECXHNC
57 I ECXLOGIC>2007 S ECODE2=ECODE2_U_ECXOEF_U_ECXOEFDT_U_ECXCLIN_U_ECXCRST_U_ECXSTCD_U_ECXPODX_U_ECXPODX1_U_ECXPODX2_U_ECXPODX3_U_ECXPODX4_U_ECXPODX5_U_ECSANPI_U_ECASNPI_U_ECATNPI_U_ECPTNPI_U_ECPANPI_U_ECSRNPI
58 S ^ECX(ECFILE,EC7,0)=ECODE,^ECX(ECFILE,EC7,1)=ECODE1,^ECX(ECFILE,EC7,2)=ECODE2,ECRN=ECRN+1
59 S DA=EC7,DIK="^ECX("_ECFILE_"," D IX1^DIK K DIK,DA
60 I $D(ZTQUEUED),$$S^%ZTLOAD S QFLG=1
61 ;
62TIME ; given date/time get increment
63 ;A1=later, A2=earlier, TIME=difference
64 N CON,TIMEDIF
65 S CON=$P($G(^SRF(ECD0,"CON")),U)
66 ;
67 ;-Get time diff (in secs) & set to .5 if < 7.5 minutes (rounds to 1)
68 S TIMEDIF=$$FMDIFF^XLFDT(A1,A2,2)/900
69 S TIMEDIF=$S(TIMEDIF>0&(TIMEDIF<.5):.5,1:TIMEDIF)
70 I 'CON D
71 .S TIME=$J($TR($J(TIMEDIF,4,0)," "),2,1)
72 .S:TIME>"99.0" TIME="99.0"
73 I CON D
74 .S TIME=$J(($TR($J(TIMEDIF,4,0)," ")/2),2,1)
75 .S:TIME>"99.5" TIME="99.5"
76 S:TIME<0 TIME="###"
77 Q
78 ;
79SETUP ;Set required input for ECXTRAC
80 S ECHEAD="SUR"
81 D ECXDEF^ECXUTL2(ECHEAD,.ECPACK,.ECGRP,.ECFILE,.ECRTN,.ECPIECE,.ECVER)
82 Q
83 ;
84QUE ; entry point for the background requeuing handled by ECXTAUTO
85 D SETUP,QUE^ECXTAUTO,^ECXKILL Q
Note: See TracBrowser for help on using the repository browser.