source: WorldVistAEHR/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACTOE3.m@ 619

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

initial load of WorldVistAEHR

File size: 9.4 KB
RevLine 
[613]1RACTOE3 ; ;01/02/09
2 D DE G BEGIN
3DE S DIE="^RAO(75.1,",DIC=DIE,DP=75.1,DL=1,DIEL=0,DU="" K DG,DE,DB Q:$O(^RAO(75.1,DA,""))=""
4 I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,4) S:%]"" DE(2)=% S %=$P(%Z,U,5) S:%]"" DE(33)=% S %=$P(%Z,U,9) S:%]"" DE(8)=% S %=$P(%Z,U,12) S:%]"" DE(13)=% S %=$P(%Z,U,13) S:%]"" DE(19)=% S %=$P(%Z,U,14) S:%]"" DE(1)=% S %=$P(%Z,U,17) S:%]"" DE(23)=%
5 I S %=$P(%Z,U,18) S:%]"" DE(34)=% S %=$P(%Z,U,21) S:%]"" DE(26)=%,DE(30)=% S %=$P(%Z,U,22) S:%]"" DE(10)=%
6 I $D(^("R")) S %Z=^("R") S %=$P(%Z,U,1) S:%]"" DE(5)=%
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="RACTOE3",DQ=1
541 S DW="0;14",DV="R*P200'X",DU="",DLB="REQUESTING PHYSICIAN",DIFLD=14
55 S DU="VA(200,"
56 S X=RAPIFN
57 S Y=X
58 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)
59 G RD:X="@",Z
60X1 Q
612 S DW="0;4",DV="SX",DU="",DLB="CATEGORY OF EXAM",DIFLD=4
62 S DU="I:INPATIENT;O:OUTPATIENT;C:CONTRACT;S:SHARING;E:EMPLOYEE;R:RESEARCH;"
63 S X=RACAT
64 S Y=X
65 G Y
66X2 Q
673 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=3 D X3 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
68X3 S Y=$E(X),Y=$S(Y="R":"@30",(Y'="")&("CS"[Y):"@40",1:"@50")
69 Q
704 S DQ=5 ;@30
715 S DW="R;1",DV="FR",DU="",DLB="RESEARCH SOURCE",DIFLD=9.5
72 S X=$S($D(RARSH):RARSH,1:"")
73 S Y=X
74 G Y
75X5 K:$L(X)>40!($L(X)<3) X
76 I $D(X),X'?.ANP K X
77 Q
78 ;
796 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=6 D X6 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
80X6 S Y="@50"
81 Q
827 S DQ=8 ;@40
838 S DW="0;9",DV="*P34'R",DU="",DLB="CONTRACT/SHARING SOURCE",DIFLD=9
84 S DU="DIC(34,"
85 S X=$S($D(RASHA):RASHA,1:"")
86 S Y=X
87 G Y
88X8 S DIC("S")="I $S('$D(^(""I"")):1,'^(""I""):1,DT'>^(""I""):1,1:0)" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
89 Q
90 ;
919 S DQ=10 ;@50
9210 S DW="0;22",DV="P44'",DU="",DLB="REQUESTING LOCATION",DIFLD=22
93 S DU="SC("
94 S X=RALIFN
95 S Y=X
96 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)
97 G RD:X="@",Z
98X10 Q
9911 S DQ=12 ;@100
10012 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=12 D X12 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
101X12 W !,"IS PATIENT SCHEDULED FOR PRE-OP" S %=2 D YN^DICN S:%<0 Y="@999" S:%=2 Y="@120" I '% W !!,"Enter 'YES' if patient is scheduled for pre-op, or 'NO' if not.",! S Y="@100"
102 Q
10313 S DW="0;12",DV="D",DU="",DLB="PRE-OP SCHEDULED DATE (TIME optional)",DIFLD=12
104 S X="TODAY"
105 S Y=X
106 G Y
107X13 S %DT="ETX" D ^%DT S X=Y K:Y<1 X
108 Q
109 ;
11014 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=14 D X14 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
111X14 S:$D(RAEXMUL) RAPREOP1=X
112 Q
11315 S DQ=16 ;@120
11416 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=16 D X16 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
115X16 I RASEX="M" S Y="@130"
116 Q
11717 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=17 D X17 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
118X17 I RASEX'="F" W !,"THE SEX OF THIS PATIENT IS NOT AVAILABLE. IS PATIENT FEMALE" S %=2 D YN^DICN S:%<0 Y="@999" S:%=2 Y="@130" I '% W !!,"Enter 'YES' if patient is female, or 'NO' if patient is male.",! S Y="@120"
119 Q
12018 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=18 D X18 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
121X18 S RASEX="F"
122 Q
12319 S DW="0;13",DV="RS",DU="",DLB="PREGNANT",DIFLD=13
124 S DU="y:YES;n:NO;u:UNKNOWN;"
125 S X=$S($D(RAPREG):$$EXTERNAL^DILFD(75.1,13,"",RAPREG),1:"")
126 S Y=X
127 G Y
128X19 Q
12920 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=20 D X20 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
130X20 S RAPREG=X
131 Q
13221 S DQ=22 ;@130
13322 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=22 D X22 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
134X22 I '$D(RAVSTFLG)!('$D(RAVLEDTI)) S Y="@135"
135 Q
13623 S DW="0;17",DV="D",DU="",DLB="PAST VISIT DATE/TIME",DIFLD=17
137 S X=9999999.9999-RAVLEDTI
138 S Y=X
139 S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
140 G RD
141X23 S %DT="TXR" D ^%DT S X=Y K:Y<1 X
142 Q
143 ;
14424 S DQ=25 ;@135
14525 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=25 D X25 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
146X25 S:$D(RAWHEN)#2 Y="@145"
147 Q
14826 S DW="0;21",DV="DR",DU="",DLB="DATE DESIRED (Not guaranteed)",DIFLD=21
149 S DE(DW)="C26^RACTOE3"
150 G RE
151C26 G C26S:$D(DE(26))[0 K DB
152 S X=DE(26),DIC=DIE
153 K ^RAO(75.1,"AP",+$P(^RAO(75.1,DA,0),U),+$P(^(0),U,2),9999999.9999-$E(X,1,30),DA)
154C26S S X="" G:DG(DQ)=X C26F1 K DB
155 S X=DG(DQ),DIC=DIE
156 S ^RAO(75.1,"AP",+$P(^RAO(75.1,DA,0),U),+$P(^(0),U,2),9999999.9999-$E(X,1,30),DA)=""
157C26F1 Q
158X26 S %DT="ETX" D ^%DT S X=Y K:Y<1 X
159 Q
160 ;
16127 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=27 D X27 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
162X27 S Y="@150"
163 Q
16428 S DQ=29 ;@145
16529 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=29 G A
16630 D:$D(DG)>9 F^DIE17,DE S DQ=30,DW="0;21",DV="DR",DU="",DLB="DATE DESIRED (Not guaranteed)",DIFLD=21
167 S DE(DW)="C30^RACTOE3"
168 S X=RAWHEN
169 S Y=X
170 G Y
171C30 G C30S:$D(DE(30))[0 K DB
172 S X=DE(30),DIC=DIE
173 K ^RAO(75.1,"AP",+$P(^RAO(75.1,DA,0),U),+$P(^(0),U,2),9999999.9999-$E(X,1,30),DA)
174C30S S X="" G:DG(DQ)=X C30F1 K DB
175 S X=DG(DQ),DIC=DIE
176 S ^RAO(75.1,"AP",+$P(^RAO(75.1,DA,0),U),+$P(^(0),U,2),9999999.9999-$E(X,1,30),DA)=""
177C30F1 Q
178X30 S %DT="ETX" D ^%DT S X=Y K:Y<1 X
179 Q
180 ;
18131 S DQ=32 ;@150
18232 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=32 D X32 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
183X32 S:$D(RAEXMUL)#2 RAWHEN=$$FMTE^XLFDT(X,1)
184 Q
18533 D:$D(DG)>9 F^DIE17,DE S DQ=33,DW="0;5",DV="SX",DU="",DLB="REQUEST STATUS",DIFLD=5
186 S DE(DW)="C33^RACTOE3"
187 S DU="1:DISCONTINUED;2:COMPLETE;3:HOLD;5:PENDING;6:ACTIVE;8:SCHEDULED;11:UNRELEASED;"
188 S X=$S($D(RAPKG):5,$$ORVR^RAORDU()=2.5:11,1:5)
189 S Y=X
190 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)
191 G RD:X="@",Z
192C33 G C33S:$D(DE(33))[0 K DB
193 S X=DE(33),DIC=DIE
194 K ^RAO(75.1,"AS",+$P(^RAO(75.1,DA,0),U),X,DA)
195 S X=DE(33),DIC=DIE
196 ;
197C33S S X="" G:DG(DQ)=X C33F1 K DB
198 S X=DG(DQ),DIC=DIE
199 S ^RAO(75.1,"AS",+$P(^RAO(75.1,DA,0),U),X,DA)=""
200 S X=DG(DQ),DIC=DIE
201 D:$$ORVR^RAORDU()=2.5&((X=1)!(X=3)) CH^RADD2(DA,X)
202C33F1 Q
203X33 Q
20434 D:$D(DG)>9 F^DIE17,DE S DQ=34,DW="0;18",DV="D",DU="",DLB="LAST ACTIVITY DATE/TIME",DIFLD=18
205 S DE(DW)="C34^RACTOE3"
206 S X="NOW"
207 S Y=X
208 S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
209 G RD
210C34 G C34S:$D(DE(34))[0 K DB
211 S X=DE(34),DIC=DIE
212 K ^RAO(75.1,"AO",$E(X,1,30),DA)
213C34S S X="" G:DG(DQ)=X C34F1 K DB
214 S X=DG(DQ),DIC=DIE
215 S ^RAO(75.1,"AO",$E(X,1,30),DA)=""
216C34F1 Q
217X34 S %DT="TXR" D ^%DT S X=Y K:Y<1 X
218 Q
219 ;
22035 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=35 D X35 D:$D(DIEFIRE)#2 FIREREC^DIE17 G A:$D(Y)[0,A:Y=U S X=Y,DIC(0)="F",DW=DQ G OUT^DIE17
221X35 S Y=$S('$D(^RA(79,+RADIV,.1)):"@160",$P(^(.1),"^",19)="y":"@155",1:"@160")
222 Q
22336 S DQ=37 ;@155
22437 D:$D(DG)>9 F^DIE17,DE S DQ=37,D=0 K DE(1) ;75
225 S DIFLD=75,DGO="^RACTOE4",DC="4^75.12DA^T^",DV="75.12D",DW="0;1",DOW="STATUS CHANGE DATE/TIME",DLB="Select "_DOW S:D DC=DC_D
226 I $D(DSC(75.12))#2,$P(DSC(75.12),"I $D(^UTILITY(",1)="" X DSC(75.12) S D=$O(^(0)) S:D="" D=-1 G M37
227 S D=$S($D(^RAO(75.1,DA,"T",0)):$P(^(0),U,3,4),$O(^(0))'="":$O(^(0)),1:-1)
228M37 I D>0 S DC=DC_D I $D(^RAO(75.1,DA,"T",+D,0)) S DE(37)=$P(^(0),U,1)
229 S X="""NOW"""
230 S Y=X
231 S X=Y,DB(DQ)=1 G:X="" N^DIE17:DV,A I $D(DE(DQ)),DV["I"!(DV["#") D E^DIE0 G A:'$D(X)
232 G RD
233R37 D DE
234 G A
235 ;
23638 S DQ=39 ;@160
23739 D:$D(DG)>9 F^DIE17 G ^RACTOE5
Note: See TracBrowser for help on using the repository browser.