source: FOIAVistA/trunk/r/RADIOLOGY_NUCLEAR_MEDICINE-RA/RACTQE3.m@ 1397

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

initial load of FOIAVistA 6/30/08 version

File size: 6.6 KB
Line 
1RACTQE3 ; ;05/26/08
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(3)=% S %=$P(%Z,U,6) S:%]"" DE(11)=% S %=$P(%Z,U,14) S:%]"" DE(1)=% S %=$P(%Z,U,18) S:%]"" DE(4)=% S %=$P(%Z,U,19) S:%]"" DE(7)=% S %=$P(%Z,U,22) S:%]"" DE(2)=% S %=$P(%Z,U,24) S:%]"" DE(9)=%
5 I S %=$P(%Z,U,26) S:%]"" DE(13)=%
6 K %Z Q
7 ;
8W W !?DL+DL-2,DLB_": "
9 Q
10O D W W Y W:$X>45 !?9
11 I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2
12 W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 S X="" W " (No Editing)" Q
13TR R X:DTIME E S (DTOUT,X)=U W $C(7)
14 Q
15A K DQ(DQ) S DQ=DQ+1
16B G @DQ
17RE G PR:$D(DE(DQ)) D W,TR
18N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
19RD G QS:X?."?" I X["^" D D G ^DIE17
20 I X="@" D D G Z^DIE2
21 I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W " "_X
22T 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
23 K DDER G X
24P 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
25 G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z
26 I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X
27V D @("X"_DQ) K YS
28Z 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
29X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
30 S X="?BAD"
31QS S DZ=X D D,QQ^DIEQ G B
32D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
33Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
34PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
35R 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
36 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
37 X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") S:%]"" Y=%
38RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
39I I DV'["I",DV'["#" G RD
40 D E^DIE0 G RD:$D(X),PR
41 Q
42SET N DIR S DIR(0)="SV"_$E("o",$D(DB(DQ)))_U_DU,DIR("V")=1
43 I $D(DB(DQ)),'$D(DIQUIET) N DIQUIET S DIQUIET=1
44 D ^DIR I 'DDER S %=Y(0),X=Y
45 Q
46SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ))
47 I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""
48 E K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")
49 Q
50NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS
51KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
52BEGIN S DNM="RACTQE3",DQ=1
531 S DW="0;14",DV="R*P200'X",DU="",DLB="REQUESTING PHYSICIAN",DIFLD=14
54 S DU="VA(200,"
55 S X=RAPIFN
56 S Y=X
57 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)
58 G RD:X="@",Z
59X1 Q
602 S DW="0;22",DV="P44'",DU="",DLB="REQUESTING LOCATION",DIFLD=22
61 S DU="SC("
62 S X=RALIFN
63 S Y=X
64 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)
65 G RD:X="@",Z
66X2 Q
673 S DW="0;5",DV="SX",DU="",DLB="REQUEST STATUS",DIFLD=5
68 S DE(DW)="C3^RACTQE3"
69 S DU="1:DISCONTINUED;2:COMPLETE;3:HOLD;5:PENDING;6:ACTIVE;8:SCHEDULED;11:UNRELEASED;"
70 S X=$S($D(RAPKG):5,$$ORVR^RAORDU()=2.5:11,1:5)
71 S Y=X
72 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)
73 G RD:X="@",Z
74C3 G C3S:$D(DE(3))[0 K DB
75 S X=DE(3),DIC=DIE
76 K ^RAO(75.1,"AS",+$P(^RAO(75.1,DA,0),U),X,DA)
77 S X=DE(3),DIC=DIE
78 ;
79C3S S X="" G:DG(DQ)=X C3F1 K DB
80 S X=DG(DQ),DIC=DIE
81 S ^RAO(75.1,"AS",+$P(^RAO(75.1,DA,0),U),X,DA)=""
82 S X=DG(DQ),DIC=DIE
83 D:$$ORVR^RAORDU()=2.5&((X=1)!(X=3)) CH^RADD2(DA,X)
84C3F1 Q
85X3 Q
864 D:$D(DG)>9 F^DIE17,DE S DQ=4,DW="0;18",DV="D",DU="",DLB="LAST ACTIVITY DATE/TIME",DIFLD=18
87 S DE(DW)="C4^RACTQE3"
88 S X="NOW"
89 S Y=X
90 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)
91 G RD
92C4 G C4S:$D(DE(4))[0 K DB
93 S X=DE(4),DIC=DIE
94 K ^RAO(75.1,"AO",$E(X,1,30),DA)
95C4S S X="" G:DG(DQ)=X C4F1 K DB
96 S X=DG(DQ),DIC=DIE
97 S ^RAO(75.1,"AO",$E(X,1,30),DA)=""
98C4F1 Q
99X4 S %DT="TXR" D ^%DT S X=Y K:Y<1 X
100 Q
101 ;
1025 D:$D(DG)>9 F^DIE17,DE S DQ=5,D=0 K DE(1) ;75
103 S DIFLD=75,DGO="^RACTQE4",DC="4^75.12DA^T^",DV="75.12D",DW="0;1",DOW="STATUS CHANGE DATE/TIME",DLB="Select "_DOW S:D DC=DC_D
104 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 M5
105 S D=$S($D(^RAO(75.1,DA,"T",0)):$P(^(0),U,3,4),$O(^(0))'="":$O(^(0)),1:-1)
106M5 I D>0 S DC=DC_D I $D(^RAO(75.1,DA,"T",+D,0)) S DE(5)=$P(^(0),U,1)
107 S X="""NOW"""
108 S Y=X
109 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)
110 G RD
111R5 D DE
112 G A
113 ;
1146 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
115X6 I '$D(RAMT) S RAMT="a"
116 Q
1177 S DW="0;19",DV="S",DU="",DLB="MODE OF TRANSPORT",DIFLD=19
118 S DU="a:AMBULATORY;p:PORTABLE;s:STRETCHER;w:WHEEL CHAIR;"
119 S X=$P(RAMT,"^")
120 S Y=X
121 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)
122 G RD:X="@",Z
123X7 Q
1248 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
125X8 I '$D(RAIP) S RAIP="n"
126 Q
1279 S DW="0;24",DV="S",DU="",DLB="ISOLATION PROCEDURES",DIFLD=24
128 S DU="y:YES;n:NO;"
129 S X=RAIP
130 S Y=X
131 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)
132 G RD:X="@",Z
133X9 Q
13410 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
135X10 I '$D(RARU) S RARU=9
136 Q
13711 S DW="0;6",DV="S",DU="",DLB="REQUEST URGENCY",DIFLD=6
138 S DU="1:STAT;2:URGENT;9:ROUTINE;"
139 S X=RARU
140 S Y=X
141 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)
142 G RD:X="@",Z
143X11 Q
14412 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
145X12 S:$$ORVR^RAORDU()<3 Y="@80"
146 Q
14713 S DW="0;26",DV="S",DU="",DLB="NATURE OF (NEW) ORDER ACTIVITY",DIFLD=26
148 S DU="w:WRITTEN;v:VERBAL;p:TELEPHONED;s:SERVICE CORRECTION;i:POLICY;e:PHYSICIAN ENTERED;"
149 S Y="s"
150 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)
151 G RD:X="@",Z
152X13 Q
15314 S DQ=15 ;@80
15415 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=15 D X15 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
155X15 S RAFIN=1
156 Q
15716 S DQ=17 ;@99
15817 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
159X17 K RAI,RAPRI,RAMOD,RAIMAG,RAREQLOC,RAMODPRO
160 Q
16118 G 0^DIE17
Note: See TracBrowser for help on using the repository browser.