1 | RACTOE6 ; ;12/27/07
|
---|
2 | D DE G BEGIN
|
---|
3 | DE 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 | ;
|
---|
7 | W W !?DL+DL-2,DLB_": "
|
---|
8 | Q
|
---|
9 | O 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
|
---|
12 | TR R X:DTIME E S (DTOUT,X)=U W $C(7)
|
---|
13 | Q
|
---|
14 | A K DQ(DQ) S DQ=DQ+1
|
---|
15 | B G @DQ
|
---|
16 | RE G PR:$D(DE(DQ)) D W,TR
|
---|
17 | N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
|
---|
18 | RD 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
|
---|
21 | T 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
|
---|
23 | P 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
|
---|
26 | V D @("X"_DQ) K YS
|
---|
27 | Z 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
|
---|
28 | X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
|
---|
29 | S X="?BAD"
|
---|
30 | QS S DZ=X D D,QQ^DIEQ G B
|
---|
31 | D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
|
---|
32 | Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
|
---|
33 | PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
|
---|
34 | R 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=%
|
---|
37 | RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
|
---|
38 | I I DV'["I",DV'["#" G RD
|
---|
39 | D E^DIE0 G RD:$D(X),PR
|
---|
40 | Q
|
---|
41 | SET 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
|
---|
45 | SAVEVALS 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
|
---|
49 | NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS
|
---|
50 | KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
|
---|
51 | BEGIN S DNM="RACTOE6",DQ=1
|
---|
52 | 1 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
|
---|
56 | X1 S %DT="ETX" D ^%DT S X=Y K:Y<1 X
|
---|
57 | Q
|
---|
58 | ;
|
---|
59 | 2 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
|
---|
60 | X2 S:$D(RAEXMUL) RAPREOP1=X
|
---|
61 | Q
|
---|
62 | 3 S DQ=4 ;@120
|
---|
63 | 4 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
|
---|
64 | X4 I RASEX="M" S Y="@130"
|
---|
65 | Q
|
---|
66 | 5 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
|
---|
67 | X5 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
|
---|
69 | 6 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
|
---|
70 | X6 S RASEX="F"
|
---|
71 | Q
|
---|
72 | 7 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
|
---|
77 | X7 Q
|
---|
78 | 8 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
|
---|
79 | X8 S RAPREG=X
|
---|
80 | Q
|
---|
81 | 9 S DQ=10 ;@130
|
---|
82 | 10 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
|
---|
83 | X10 I '$D(RAVSTFLG)!('$D(RAVLEDTI)) S Y="@135"
|
---|
84 | Q
|
---|
85 | 11 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
|
---|
90 | X11 S %DT="TXR" D ^%DT S X=Y K:Y<1 X
|
---|
91 | Q
|
---|
92 | ;
|
---|
93 | 12 S DQ=13 ;@135
|
---|
94 | 13 S DQ=14 ;@140
|
---|
95 | 14 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
|
---|
96 | X14 S:$D(RAWHEN)#2 Y="@145"
|
---|
97 | Q
|
---|
98 | 15 S DW="0;21",DV="DR",DU="",DLB="DATE DESIRED (Not guaranteed)",DIFLD=21
|
---|
99 | S DE(DW)="C15^RACTOE6"
|
---|
100 | G RE
|
---|
101 | C15 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)
|
---|
104 | C15S 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)=""
|
---|
107 | C15F1 Q
|
---|
108 | X15 S %DT="ETX" D ^%DT S X=Y K:Y<1 X
|
---|
109 | Q
|
---|
110 | ;
|
---|
111 | 16 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
|
---|
112 | X16 S Y="@150"
|
---|
113 | Q
|
---|
114 | 17 S DQ=18 ;@145
|
---|
115 | 18 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
|
---|
120 | C18 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)
|
---|
123 | C18S 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)=""
|
---|
126 | C18F1 Q
|
---|
127 | X18 S %DT="ETX" D ^%DT S X=Y K:Y<1 X
|
---|
128 | Q
|
---|
129 | ;
|
---|
130 | 19 S DQ=20 ;@150
|
---|
131 | 20 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
|
---|
132 | X20 S:$D(RAEXMUL)#2 RAWHEN=$$FMTE^XLFDT(X,1)
|
---|
133 | Q
|
---|
134 | 21 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
|
---|
141 | C21 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 | ;
|
---|
146 | C21S 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)
|
---|
151 | C21F1 Q
|
---|
152 | X21 Q
|
---|
153 | 22 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
|
---|
159 | C22 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)
|
---|
162 | C22S 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)=""
|
---|
165 | C22F1 Q
|
---|
166 | X22 S %DT="TXR" D ^%DT S X=Y K:Y<1 X
|
---|
167 | Q
|
---|
168 | ;
|
---|
169 | 23 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
|
---|
170 | X23 S Y=$S('$D(^RA(79,+RADIV,.1)):"@160",$P(^(.1),"^",19)="y":"@155",1:"@160")
|
---|
171 | Q
|
---|
172 | 24 S DQ=25 ;@155
|
---|
173 | 25 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)
|
---|
177 | M25 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
|
---|
182 | R25 D DE
|
---|
183 | G A
|
---|
184 | ;
|
---|
185 | 26 S DQ=27 ;@160
|
---|
186 | 27 D:$D(DG)>9 F^DIE17 G ^RACTOE8
|
---|