source: WorldVistAEHR/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACTOE6.m@ 1450

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

initial load of WorldVistAEHR

File size: 7.6 KB
Line 
1RACTOE6 ; ;12/27/07
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,5) S:%]"" DE(21)=% S %=$P(%Z,U,12) S:%]"" DE(1)=% S %=$P(%Z,U,13) S:%]"" DE(7)=% S %=$P(%Z,U,17) S:%]"" DE(11)=% S %=$P(%Z,U,18) S:%]"" DE(22)=% S %=$P(%Z,U,21) S:%]"" DE(15)=%,DE(18)=%
5 K %Z Q
6 ;
7W W !?DL+DL-2,DLB_": "
8 Q
9O D W W Y W:$X>45 !?9
10 I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2
11 W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 S X="" W " (No Editing)" Q
12TR R X:DTIME E S (DTOUT,X)=U W $C(7)
13 Q
14A K DQ(DQ) S DQ=DQ+1
15B G @DQ
16RE G PR:$D(DE(DQ)) D W,TR
17N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
18RD G QS:X?."?" I X["^" D D G ^DIE17
19 I X="@" D D G Z^DIE2
20 I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W " "_X
21T 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
22 K DDER G X
23P 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
24 G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z
25 I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X
26V D @("X"_DQ) K YS
27Z 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
28X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
29 S X="?BAD"
30QS S DZ=X D D,QQ^DIEQ G B
31D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
32Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
33PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
34R 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
35 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
36 X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") S:%]"" Y=%
37RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
38I I DV'["I",DV'["#" G RD
39 D E^DIE0 G RD:$D(X),PR
40 Q
41SET N DIR S DIR(0)="SV"_$E("o",$D(DB(DQ)))_U_DU,DIR("V")=1
42 I $D(DB(DQ)),'$D(DIQUIET) N DIQUIET S DIQUIET=1
43 D ^DIR I 'DDER S %=Y(0),X=Y
44 Q
45SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ))
46 I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""
47 E K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")
48 Q
49NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS
50KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
51BEGIN S DNM="RACTOE6",DQ=1
521 D:$D(DG)>9 F^DIE17,DE S DQ=1,DW="0;12",DV="D",DU="",DLB="PRE-OP SCHEDULED DATE (TIME optional)",DIFLD=12
53 S X="TODAY"
54 S Y=X
55 G Y
56X1 S %DT="ETX" D ^%DT S X=Y K:Y<1 X
57 Q
58 ;
592 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=2 D X2 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
60X2 S:$D(RAEXMUL) RAPREOP1=X
61 Q
623 S DQ=4 ;@120
634 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=4 D X4 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
64X4 I RASEX="M" S Y="@130"
65 Q
665 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=5 D X5 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
67X5 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"
68 Q
696 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
70X6 S RASEX="F"
71 Q
727 S DW="0;13",DV="RS",DU="",DLB="PREGNANT",DIFLD=13
73 S DU="y:YES;n:NO;u:UNKNOWN;"
74 S X=$S($D(RAPREG):$$EXTERNAL^DILFD(75.1,13,"",RAPREG),1:"")
75 S Y=X
76 G Y
77X7 Q
788 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=8 D X8 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
79X8 S RAPREG=X
80 Q
819 S DQ=10 ;@130
8210 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=10 D X10 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
83X10 I '$D(RAVSTFLG)!('$D(RAVLEDTI)) S Y="@135"
84 Q
8511 S DW="0;17",DV="D",DU="",DLB="PAST VISIT DATE/TIME",DIFLD=17
86 S X=9999999.9999-RAVLEDTI
87 S Y=X
88 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)
89 G RD
90X11 S %DT="TXR" D ^%DT S X=Y K:Y<1 X
91 Q
92 ;
9312 S DQ=13 ;@135
9413 S DQ=14 ;@140
9514 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
96X14 S:$D(RAWHEN)#2 Y="@145"
97 Q
9815 S DW="0;21",DV="DR",DU="",DLB="DATE DESIRED (Not guaranteed)",DIFLD=21
99 S DE(DW)="C15^RACTOE6"
100 G RE
101C15 G C15S:$D(DE(15))[0 K DB
102 S X=DE(15),DIC=DIE
103 K ^RAO(75.1,"AP",+$P(^RAO(75.1,DA,0),U),+$P(^(0),U,2),9999999.9999-$E(X,1,30),DA)
104C15S S X="" G:DG(DQ)=X C15F1 K DB
105 S X=DG(DQ),DIC=DIE
106 S ^RAO(75.1,"AP",+$P(^RAO(75.1,DA,0),U),+$P(^(0),U,2),9999999.9999-$E(X,1,30),DA)=""
107C15F1 Q
108X15 S %DT="ETX" D ^%DT S X=Y K:Y<1 X
109 Q
110 ;
11116 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
112X16 S Y="@150"
113 Q
11417 S DQ=18 ;@145
11518 D:$D(DG)>9 F^DIE17,DE S DQ=18,DW="0;21",DV="D",DU="",DLB="DATE DESIRED (Not guaranteed)",DIFLD=21
116 S DE(DW)="C18^RACTOE6"
117 S X=RAWHEN
118 S Y=X
119 G Y
120C18 G C18S:$D(DE(18))[0 K DB
121 S X=DE(18),DIC=DIE
122 K ^RAO(75.1,"AP",+$P(^RAO(75.1,DA,0),U),+$P(^(0),U,2),9999999.9999-$E(X,1,30),DA)
123C18S S X="" G:DG(DQ)=X C18F1 K DB
124 S X=DG(DQ),DIC=DIE
125 S ^RAO(75.1,"AP",+$P(^RAO(75.1,DA,0),U),+$P(^(0),U,2),9999999.9999-$E(X,1,30),DA)=""
126C18F1 Q
127X18 S %DT="ETX" D ^%DT S X=Y K:Y<1 X
128 Q
129 ;
13019 S DQ=20 ;@150
13120 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
132X20 S:$D(RAEXMUL)#2 RAWHEN=$$FMTE^XLFDT(X,1)
133 Q
13421 D:$D(DG)>9 F^DIE17,DE S DQ=21,DW="0;5",DV="SX",DU="",DLB="REQUEST STATUS",DIFLD=5
135 S DE(DW)="C21^RACTOE6"
136 S DU="1:DISCONTINUED;2:COMPLETE;3:HOLD;5:PENDING;6:ACTIVE;8:SCHEDULED;11:UNRELEASED;"
137 S X=$S($D(RAPKG):5,$$ORVR^RAORDU()=2.5:11,1:5)
138 S Y=X
139 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)
140 G RD:X="@",Z
141C21 G C21S:$D(DE(21))[0 K DB
142 S X=DE(21),DIC=DIE
143 K ^RAO(75.1,"AS",+$P(^RAO(75.1,DA,0),U),X,DA)
144 S X=DE(21),DIC=DIE
145 ;
146C21S S X="" G:DG(DQ)=X C21F1 K DB
147 S X=DG(DQ),DIC=DIE
148 S ^RAO(75.1,"AS",+$P(^RAO(75.1,DA,0),U),X,DA)=""
149 S X=DG(DQ),DIC=DIE
150 D:$$ORVR^RAORDU()=2.5&((X=1)!(X=3)) CH^RADD2(DA,X)
151C21F1 Q
152X21 Q
15322 D:$D(DG)>9 F^DIE17,DE S DQ=22,DW="0;18",DV="D",DU="",DLB="LAST ACTIVITY DATE/TIME",DIFLD=18
154 S DE(DW)="C22^RACTOE6"
155 S X="NOW"
156 S Y=X
157 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)
158 G RD
159C22 G C22S:$D(DE(22))[0 K DB
160 S X=DE(22),DIC=DIE
161 K ^RAO(75.1,"AO",$E(X,1,30),DA)
162C22S S X="" G:DG(DQ)=X C22F1 K DB
163 S X=DG(DQ),DIC=DIE
164 S ^RAO(75.1,"AO",$E(X,1,30),DA)=""
165C22F1 Q
166X22 S %DT="TXR" D ^%DT S X=Y K:Y<1 X
167 Q
168 ;
16923 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=23 D X23 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
170X23 S Y=$S('$D(^RA(79,+RADIV,.1)):"@160",$P(^(.1),"^",19)="y":"@155",1:"@160")
171 Q
17224 S DQ=25 ;@155
17325 D:$D(DG)>9 F^DIE17,DE S DQ=25,D=0 K DE(1) ;75
174 S DIFLD=75,DGO="^RACTOE7",DC="4^75.12DA^T^",DV="75.12D",DW="0;1",DOW="STATUS CHANGE DATE/TIME",DLB="Select "_DOW S:D DC=DC_D
175 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 M25
176 S D=$S($D(^RAO(75.1,DA,"T",0)):$P(^(0),U,3,4),$O(^(0))'="":$O(^(0)),1:-1)
177M25 I D>0 S DC=DC_D I $D(^RAO(75.1,DA,"T",+D,0)) S DE(25)=$P(^(0),U,1)
178 S X="""NOW"""
179 S Y=X
180 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)
181 G RD
182R25 D DE
183 G A
184 ;
18526 S DQ=27 ;@160
18627 D:$D(DG)>9 F^DIE17 G ^RACTOE8
Note: See TracBrowser for help on using the repository browser.