1 | RACTOE3 ; ;05/26/08
|
---|
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,4) S:%]"" DE(10)=% S %=$P(%Z,U,9) S:%]"" DE(16)=% S %=$P(%Z,U,12) S:%]"" DE(21)=% S %=$P(%Z,U,13) S:%]"" DE(27)=% S %=$P(%Z,U,14) S:%]"" DE(9)=% S %=$P(%Z,U,17) S:%]"" DE(31)=% S %=$P(%Z,U,22) S:%]"" DE(18)=%
|
---|
5 | I $D(^("R")) S %Z=^("R") S %=$P(%Z,U,1) S:%]"" DE(13)=%
|
---|
6 | K %Z Q
|
---|
7 | ;
|
---|
8 | W W !?DL+DL-2,DLB_": "
|
---|
9 | Q
|
---|
10 | O 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
|
---|
13 | TR R X:DTIME E S (DTOUT,X)=U W $C(7)
|
---|
14 | Q
|
---|
15 | A K DQ(DQ) S DQ=DQ+1
|
---|
16 | B G @DQ
|
---|
17 | RE G PR:$D(DE(DQ)) D W,TR
|
---|
18 | N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
|
---|
19 | RD 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
|
---|
22 | 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
|
---|
23 | K DDER G X
|
---|
24 | 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
|
---|
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
|
---|
27 | V D @("X"_DQ) K YS
|
---|
28 | 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
|
---|
29 | X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
|
---|
30 | S X="?BAD"
|
---|
31 | QS S DZ=X D D,QQ^DIEQ G B
|
---|
32 | D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
|
---|
33 | Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
|
---|
34 | PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
|
---|
35 | 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
|
---|
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=%
|
---|
38 | RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
|
---|
39 | I I DV'["I",DV'["#" G RD
|
---|
40 | D E^DIE0 G RD:$D(X),PR
|
---|
41 | Q
|
---|
42 | SET 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
|
---|
46 | SAVEVALS 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
|
---|
50 | NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS
|
---|
51 | KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
|
---|
52 | BEGIN S DNM="RACTOE3",DQ=1
|
---|
53 | 1 S D=0 K DE(1) ;400
|
---|
54 | S Y="CLINICAL HISTORY FOR EXAM^W^^0;1^Q",DG="H",DC="^75.11" D DIEN^DIWE K DE(1) G A
|
---|
55 | ;
|
---|
56 | 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
|
---|
57 | X2 I $D(DIRUT) S Y="@999"
|
---|
58 | Q
|
---|
59 | 3 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
|
---|
60 | X3 S:+$O(^RAO(75.1,DA,"H",0))=0 Y="@15"
|
---|
61 | Q
|
---|
62 | 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
|
---|
63 | X4 S RAWPFLAG=$$VALWP^RAUTL5("^RAO(75.1,"_DA_",""H"",")
|
---|
64 | Q
|
---|
65 | 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
|
---|
66 | X5 I 'RAWPFLAG W !!?3,$C(7),"Text must be at least two (2) alphanumeric characters in length.",! S Y="@10"
|
---|
67 | Q
|
---|
68 | 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
|
---|
69 | X6 I $P($G(^RAO(75.1,DA,"H",0)),U,3)>350 W ?3,$C(7),"Clinical History cannot exceed 350 lines!" S Y="@10"
|
---|
70 | Q
|
---|
71 | 7 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=7 D X7 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
|
---|
72 | X7 I $O(^RAO(75.1,DA,"H",0)) D UPDT^RAUTL3("^RAO(75.1,"_DA_",""H"",")
|
---|
73 | Q
|
---|
74 | 8 S DQ=9 ;@15
|
---|
75 | 9 S DW="0;14",DV="R*P200'X",DU="",DLB="REQUESTING PHYSICIAN",DIFLD=14
|
---|
76 | S DU="VA(200,"
|
---|
77 | S X=RAPIFN
|
---|
78 | S Y=X
|
---|
79 | 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)
|
---|
80 | G RD:X="@",Z
|
---|
81 | X9 Q
|
---|
82 | 10 S DW="0;4",DV="SX",DU="",DLB="CATEGORY OF EXAM",DIFLD=4
|
---|
83 | S DU="I:INPATIENT;O:OUTPATIENT;C:CONTRACT;S:SHARING;E:EMPLOYEE;R:RESEARCH;"
|
---|
84 | S X=RACAT
|
---|
85 | S Y=X
|
---|
86 | G Y
|
---|
87 | X10 Q
|
---|
88 | 11 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=11 D X11 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
|
---|
89 | X11 S Y=$E(X),Y=$S(Y="R":"@30",(Y'="")&("CS"[Y):"@40",1:"@50")
|
---|
90 | Q
|
---|
91 | 12 S DQ=13 ;@30
|
---|
92 | 13 S DW="R;1",DV="FR",DU="",DLB="RESEARCH SOURCE",DIFLD=9.5
|
---|
93 | S X=$S($D(RARSH):RARSH,1:"")
|
---|
94 | S Y=X
|
---|
95 | G Y
|
---|
96 | X13 K:$L(X)>40!($L(X)<3) X
|
---|
97 | I $D(X),X'?.ANP K X
|
---|
98 | Q
|
---|
99 | ;
|
---|
100 | 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
|
---|
101 | X14 S Y="@50"
|
---|
102 | Q
|
---|
103 | 15 S DQ=16 ;@40
|
---|
104 | 16 S DW="0;9",DV="*P34'R",DU="",DLB="CONTRACT/SHARING SOURCE",DIFLD=9
|
---|
105 | S DU="DIC(34,"
|
---|
106 | S X=$S($D(RASHA):RASHA,1:"")
|
---|
107 | S Y=X
|
---|
108 | G Y
|
---|
109 | X16 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
|
---|
110 | Q
|
---|
111 | ;
|
---|
112 | 17 S DQ=18 ;@50
|
---|
113 | 18 S DW="0;22",DV="P44'",DU="",DLB="REQUESTING LOCATION",DIFLD=22
|
---|
114 | S DU="SC("
|
---|
115 | S X=RALIFN
|
---|
116 | S Y=X
|
---|
117 | 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)
|
---|
118 | G RD:X="@",Z
|
---|
119 | X18 Q
|
---|
120 | 19 S DQ=20 ;@100
|
---|
121 | 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
|
---|
122 | X20 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"
|
---|
123 | Q
|
---|
124 | 21 S DW="0;12",DV="D",DU="",DLB="PRE-OP SCHEDULED DATE (TIME optional)",DIFLD=12
|
---|
125 | S X="TODAY"
|
---|
126 | S Y=X
|
---|
127 | G Y
|
---|
128 | X21 S %DT="ETX" D ^%DT S X=Y K:Y<1 X
|
---|
129 | Q
|
---|
130 | ;
|
---|
131 | 22 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
|
---|
132 | X22 S:$D(RAEXMUL) RAPREOP1=X
|
---|
133 | Q
|
---|
134 | 23 S DQ=24 ;@120
|
---|
135 | 24 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=24 D X24 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
|
---|
136 | X24 I RASEX="M" S Y="@130"
|
---|
137 | Q
|
---|
138 | 25 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
|
---|
139 | X25 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"
|
---|
140 | Q
|
---|
141 | 26 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=26 D X26 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
|
---|
142 | X26 S RASEX="F"
|
---|
143 | Q
|
---|
144 | 27 S DW="0;13",DV="RS",DU="",DLB="PREGNANT",DIFLD=13
|
---|
145 | S DU="y:YES;n:NO;u:UNKNOWN;"
|
---|
146 | S X=$S($D(RAPREG):$$EXTERNAL^DILFD(75.1,13,"",RAPREG),1:"")
|
---|
147 | S Y=X
|
---|
148 | G Y
|
---|
149 | X27 Q
|
---|
150 | 28 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=28 D X28 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
|
---|
151 | X28 S RAPREG=X
|
---|
152 | Q
|
---|
153 | 29 S DQ=30 ;@130
|
---|
154 | 30 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=30 D X30 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
|
---|
155 | X30 I '$D(RAVSTFLG)!('$D(RAVLEDTI)) S Y="@135"
|
---|
156 | Q
|
---|
157 | 31 S DW="0;17",DV="D",DU="",DLB="PAST VISIT DATE/TIME",DIFLD=17
|
---|
158 | S X=9999999.9999-RAVLEDTI
|
---|
159 | S Y=X
|
---|
160 | 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)
|
---|
161 | G RD
|
---|
162 | X31 S %DT="TXR" D ^%DT S X=Y K:Y<1 X
|
---|
163 | Q
|
---|
164 | ;
|
---|
165 | 32 S DQ=33 ;@135
|
---|
166 | 33 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=33 D X33 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
|
---|
167 | X33 S:$D(RAWHEN)#2 Y="@145"
|
---|
168 | Q
|
---|
169 | 34 D:$D(DG)>9 F^DIE17 G ^RACTOE4
|
---|