source: WorldVistAEHR/trunk/r/EVENT_CAPTURE-EC--ECT--ECX/ECMXP.m@ 724

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

initial load of WorldVistAEHR

File size: 7.7 KB
RevLine 
[613]1ECMXP ; GENERATED FROM 'EC CREATE PATIENT ENTRY' INPUT TEMPLATE(#1503), FILE 721;10/08/06
2 D DE G BEGIN
3DE S DIE="^ECH(",DIC=DIE,DP=721,DL=1,DIEL=0,DU="" K DG,DE,DB Q:$O(^ECH(DA,""))=""
4 I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,2) S:%]"" DE(1)=% S %=$P(%Z,U,3) S:%]"" DE(2)=% S %=$P(%Z,U,4) S:%]"" DE(3)=% S %=$P(%Z,U,5) S:%]"" DE(4)=% S %=$P(%Z,U,6) S:%]"" DE(5)=% S %=$P(%Z,U,7) S:%]"" DE(6)=% S %=$P(%Z,U,8) S:%]"" DE(7)=%
5 I S %=$P(%Z,U,9) S:%]"" DE(8)=% S %=$P(%Z,U,10) S:%]"" DE(9)=% S %=$P(%Z,U,12) S:%]"" DE(10)=% S %=$P(%Z,U,13) S:%]"" DE(11)=%
6 I $D(^("P")) S %Z=^("P") S %=$P(%Z,U,1) S:%]"" DE(12)=% S %=$P(%Z,U,2) S:%]"" DE(13)=% S %=$P(%Z,U,3) S:%]"" DE(14)=% S %=$P(%Z,U,4) S:%]"" DE(15)=%
7 K %Z Q
8 ;
9W W !?DL+DL-2,DLB_": "
10 Q
11O D W W Y W:$X>45 !?9
12 I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2
13 W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 S X="" W " (No Editing)" Q
14TR R X:DTIME E S (DTOUT,X)=U W $C(7)
15 Q
16A K DQ(DQ) S DQ=DQ+1
17B G @DQ
18RE G PR:$D(DE(DQ)) D W,TR
19N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
20RD G QS:X?."?" I X["^" D D G ^DIE17
21 I X="@" D D G Z^DIE2
22 I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W " "_X
23T G M^DIE17:DV,^DIE3:DV["V",P:DV'["S" X:$D(^DD(DP,DIFLD,12.1)) ^(12.1) I X?.ANP D SET I 'DDER X:$D(DIC("S")) DIC("S") I W:'$D(DB(DQ)) " "_% G V
24 K DDER G X
25P I DV["P" S DIC=U_DU,DIC(0)=$E("EN",$D(DB(DQ))+1)_"M"_$E("L",DV'["'") S:DIC(0)["L" DLAYGO=+$P(DV,"P",2) G:DV["*" AST^DIED D NOSCR^DIED S X=+Y,DIC=DIE G X:X<0
26 G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z
27 I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X
28V D @("X"_DQ) K YS
29Z K DIC("S"),DLAYGO I $D(X),X'=U D:$G(DE(DW,"INDEX")) SAVEVALS G:'$$KEYCHK UNIQFERR^DIE17 S DG(DW)=X S:DV["d" ^DISV(DUZ,"DIE",DLB)=X G A
30X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
31 S X="?BAD"
32QS S DZ=X D D,QQ^DIEQ G B
33D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
34Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
35PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
36R I DG["P",@("$D(^"_X_"0))") S X=+$P(^(0),U,2) G RP:'$D(^(Y,0)) S Y=$P(^(0),U),X=$P(^DD(X,.01,0),U,3),DG=$P(^(0),U,2) G R
37 I DG["V",+Y,$P(Y,";",2)["(",$D(@(U_$P(Y,";",2)_"0)")) S X=+$P(^(0),U,2) G RP:'$D(^(+Y,0)) S Y=$P(^(0),U) I $D(^DD(+X,.01,0)) S DG=$P(^(0),U,2),X=$P(^(0),U,3) G R
38 X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") S:%]"" Y=%
39RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
40I I DV'["I",DV'["#" G RD
41 D E^DIE0 G RD:$D(X),PR
42 Q
43SET N DIR S DIR(0)="SV"_$E("o",$D(DB(DQ)))_U_DU,DIR("V")=1
44 I $D(DB(DQ)),'$D(DIQUIET) N DIQUIET S DIQUIET=1
45 D ^DIR I 'DDER S %=Y(0),X=Y
46 Q
47SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ))
48 I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""
49 E K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")
50 Q
51NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS
52KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
53BEGIN S DNM="ECMXP",DQ=1
54 N DIEZTMP,DIEZAR,DIEZRXR,DIIENS,DIXR K DIEFIRE,DIEBADK S DIEZTMP=$$GETTMP^DIKC1("DIEZ")
55 M DIEZAR=^DIE(1503,"AR") S DICRREC="TRIG^DIE17"
56 S:$D(DTIME)[0 DTIME=300 S D0=DA,DIIENS=DA_",",DIEZ=1503,U="^"
571 S DW="0;2",DV="RP2'",DU="",DLB="PATIENT",DIFLD=1
58 S DE(DW)="C1^ECMXP"
59 S DU="DPT("
60 S X=$G(ECPTR("DFN"))
61 S Y=X
62 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
63 G RD:X="@",Z
64C1 G C1S:$D(DE(1))[0 K DB
65 S X=DE(1),DIC=DIE
66 D KAPAT^ECDUTL
67 S X=DE(1),DIC=DIE
68 D KADTP^ECDUTL
69C1S S X="" G:DG(DQ)=X C1F1 K DB
70 S X=DG(DQ),DIC=DIE
71 D APAT^ECDUTL
72 S X=DG(DQ),DIC=DIE
73 D ADTP^ECDUTL
74C1F1 Q
75X1 Q
762 D:$D(DG)>9 F^DIE17,DE S DQ=2,DW="0;3",DV="RD",DU="",DLB="DATE/TIME OF PROCEDURE",DIFLD=2
77 S DE(DW)="C2^ECMXP"
78 S X=$G(ECPRR("PROCDT"))
79 S Y=X
80 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
81 G RD:X="@",Z
82C2 G C2S:$D(DE(2))[0 K DB
83 S X=DE(2),DIC=DIE
84 D KILLADT^ECDUTL
85 S X=DE(2),DIC=DIE
86 K ^ECH("AC",$E(X,1,30),DA)
87 S X=DE(2),DIC=DIE
88 X "Q:$P(^ECH(DA,0),U,4)']"""" K ^ECH(""AC1"",$P(^(0),U,4),X,DA)"
89 S X=DE(2),DIC=DIE
90 D KAPAT1^ECDUTL
91C2S S X="" G:DG(DQ)=X C2F1 K DB
92 S X=DG(DQ),DIC=DIE
93 D ADT^ECDUTL
94 S X=DG(DQ),DIC=DIE
95 S ^ECH("AC",$E(X,1,30),DA)=""
96 S X=DG(DQ),DIC=DIE
97 X "Q:$P(^ECH(DA,0),U,4)']"""" S ^ECH(""AC1"",$P(^(0),U,4),X,DA)="""""
98 S X=DG(DQ),DIC=DIE
99 D APAT1^ECDUTL
100C2F1 Q
101X2 Q
1023 D:$D(DG)>9 F^DIE17,DE S DQ=3,DW="0;4",DV="R*P4'",DU="",DLB="LOCATION",DIFLD=3
103 S DE(DW)="C3^ECMXP"
104 S DU="DIC(4,"
105 S X=$G(ECL)
106 S Y=X
107 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
108 G RD:X="@",Z
109C3 G C3S:$D(DE(3))[0 K DB
110 S X=DE(3),DIC=DIE
111 X "Q:$P(^ECH(DA,0),U,3)']"""" K ^ECH(""AC1"",X,$P(^(0),U,3),DA)"
112 S X=DE(3),DIC=DIE
113 D KADTL^ECDUTL
114C3S S X="" G:DG(DQ)=X C3F1 K DB
115 S X=DG(DQ),DIC=DIE
116 X "Q:$P(^ECH(DA,0),U,3)']"""" S ^ECH(""AC1"",X,$P(^(0),U,3),DA)="""""
117 S X=DG(DQ),DIC=DIE
118 D ADTL^ECDUTL
119C3F1 Q
120X3 Q
1214 D:$D(DG)>9 F^DIE17,DE S DQ=4,DW="0;5",DV="RP49'",DU="",DLB="SERVICE",DIFLD=4
122 S DU="DIC(49,"
123 S X=$P($G(^ECD(+$P($G(ECDSSU),"^"),0)),"^",2)
124 S Y=X
125 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
126 G RD:X="@",Z
127X4 Q
1285 S DW="0;6",DV="RP723'",DU="",DLB="SECTION",DIFLD=5
129 S DU="ECC(723,"
130 S X=$P($G(^ECD(+$P($G(ECDSSU),"^"),0)),"^",3)
131 S Y=X
132 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
133 G RD:X="@",Z
134X5 Q
1356 S DW="0;7",DV="RP724'",DU="",DLB="DSS UNIT",DIFLD=6
136 S DE(DW)="C6^ECMXP"
137 S DU="ECD("
138 S X=$P($G(ECDSSU),"^")
139 S Y=X
140 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
141 G RD:X="@",Z
142C6 G C6S:$D(DE(6))[0 K DB
143 S X=DE(6),DIC=DIE
144 D KADTU^ECDUTL
145C6S S X="" G:DG(DQ)=X C6F1 K DB
146 S X=DG(DQ),DIC=DIE
147 D ADTU^ECDUTL
148C6F1 Q
149X6 Q
1507 D:$D(DG)>9 F^DIE17,DE S DQ=7,DW="0;8",DV="P726'",DU="",DLB="CATEGORY",DIFLD=7
151 S DU="EC(726,"
152 S X=+$P($G(ECCAT),"^")
153 S Y=X
154 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
155 G RD:X="@",Z
156X7 Q
1578 S DW="0;9",DV="RV",DU="",DLB="PROCEDURE",DIFLD=8
158 S X=$G(ECPRR("PROC"))
159 S Y=X
160 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
161 G RD:X="@",Z
162X8 Q
1639 S DW="0;10",DV="RNJ4,0",DU="",DLB="VOLUME",DIFLD=9
164 S X=$G(ECPRR("VOL"))
165 S Y=X
166 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
167 G RD:X="@",Z
168X9 Q
16910 S DW="0;12",DV="RP723'",DU="",DLB="ORDERING SECTION",DIFLD=11
170 S DU="ECC(723,"
171 S X=$G(ECPTR("ORDSEC"))
172 S Y=X
173 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
174 G RD:X="@",Z
175X10 Q
17611 S DW="0;13",DV="RP200'",DU="",DLB="ENTERED/EDITED BY",DIFLD=13
177 S DU="VA(200,"
178 S X=$G(DUZ)
179 S Y=X
180 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
181 G RD:X="@",Z
182X11 Q
18312 S DW="P;1",DV="P81'",DU="",DLB="PCE CPT CODE",DIFLD=19
184 S DU="ICPT("
185 S X=$G(ECPRR("PCEPR"))
186 S Y=X
187 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
188 G RD:X="@",Z
189X12 Q
19013 S DW="P;2",DV="R*P80'X",DU="",DLB="PRIMARY ICD-9 CODE",DIFLD=20
191 S DU="ICD9("
192 S X=$G(ECPTR("DX"))
193 S Y=X
194 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
195 G RD:X="@",Z
196X13 Q
19714 S DW="P;3",DV="S",DU="",DLB="AGENT ORANGE",DIFLD=21
198 S DU="Y:YES;N:NO;U:UNKNOWN;"
199 S X=$G(ECPTR("AO"))
200 S Y=X
201 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
202 G RD:X="@",Z
203X14 Q
20415 S DW="P;4",DV="S",DU="",DLB="RADIATION EXPOSURE",DIFLD=22
205 S DU="Y:YES;N:NO;U:UNKNOWN;"
206 S X=$G(ECPTR("IR"))
207 S Y=X
208 S X=Y,DB(DQ)=1,DE(DW,"4/")="" G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
209 G RD:X="@",Z
210X15 Q
21116 D:$D(DG)>9 F^DIE17 G ^ECMXP1
Note: See TracBrowser for help on using the repository browser.