1 | ACKQTE5 ; ;07/15/03
|
---|
2 | D DE G BEGIN
|
---|
3 | DE S DIE="^ACK(509850.6,",DIC=DIE,DP=509850.6,DL=1,DIEL=0,DU="" K DG,DE,DB Q:$O(^ACK(509850.6,DA,""))=""
|
---|
4 | I $D(^(2)) S %Z=^(2) S %=$P(%Z,U,2) S:%]"" DE(18)=% S %=$P(%Z,U,9) S:%]"" DE(15)=%
|
---|
5 | I $D(^(5)) S %Z=^(5) S %=$P(%Z,U,4) S:%]"" DE(1)=% S %=$P(%Z,U,5) S:%]"" DE(6)=% S %=$P(%Z,U,6) S:%]"" DE(11)=%
|
---|
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="ACKQTE5",DQ=1
|
---|
53 | 1 D:$D(DG)>9 F^DIE17,DE S DQ=1,DW="5;4",DV="RS",DU="",DLB="Was care related to AO Exposure ?",DIFLD=25
|
---|
54 | S DE(DW)="C1^ACKQTE5"
|
---|
55 | S DU="0:NO;1:YES;"
|
---|
56 | S X=""
|
---|
57 | S Y=X
|
---|
58 | G Y
|
---|
59 | C1 G C1S:$D(DE(1))[0 K DB
|
---|
60 | S X=DE(1),DIC=DIE
|
---|
61 | X "D SEND^ACKQUTL5(DA)"
|
---|
62 | C1S S X="" G:DG(DQ)=X C1F1 K DB
|
---|
63 | S X=DG(DQ),DIC=DIE
|
---|
64 | X "D SEND^ACKQUTL5(DA)"
|
---|
65 | C1F1 Q
|
---|
66 | X1 Q
|
---|
67 | 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
|
---|
68 | X2 S ACKAO=$S(ACKAO=0:0,ACKSC'=1:ACKAO,X=1:2,1:1)
|
---|
69 | Q
|
---|
70 | 3 S DQ=4 ;@80
|
---|
71 | 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
|
---|
72 | X4 I ACKRAD=0 S Y="@90"
|
---|
73 | Q
|
---|
74 | 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
|
---|
75 | X5 I ACKSC=2 S Y="@100"
|
---|
76 | Q
|
---|
77 | 6 D:$D(DG)>9 F^DIE17,DE S DQ=6,DW="5;5",DV="RS",DU="",DLB="Was care related to IR Exposure ?",DIFLD=30
|
---|
78 | S DE(DW)="C6^ACKQTE5"
|
---|
79 | S DU="0:NO;1:YES;"
|
---|
80 | S X=""
|
---|
81 | S Y=X
|
---|
82 | G Y
|
---|
83 | C6 G C6S:$D(DE(6))[0 K DB
|
---|
84 | S X=DE(6),DIC=DIE
|
---|
85 | X "D SEND^ACKQUTL5(DA)"
|
---|
86 | C6S S X="" G:DG(DQ)=X C6F1 K DB
|
---|
87 | S X=DG(DQ),DIC=DIE
|
---|
88 | X "D SEND^ACKQUTL5(DA)"
|
---|
89 | C6F1 Q
|
---|
90 | X6 Q
|
---|
91 | 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
|
---|
92 | X7 S ACKRAD=$S(ACKRAD=0:0,ACKSC'=1:ACKRAD,X=1:2,1:1)
|
---|
93 | Q
|
---|
94 | 8 S DQ=9 ;@90
|
---|
95 | 9 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=9 D X9 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 | X9 I ACKENV=0 S Y="@100"
|
---|
97 | Q
|
---|
98 | 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
|
---|
99 | X10 I ACKSC=2 S Y="@100"
|
---|
100 | Q
|
---|
101 | 11 D:$D(DG)>9 F^DIE17,DE S DQ=11,DW="5;6",DV="RS",DU="",DLB="Was care related to EC Exposure ?",DIFLD=35
|
---|
102 | S DE(DW)="C11^ACKQTE5"
|
---|
103 | S DU="0:NO;1:YES;"
|
---|
104 | S X=""
|
---|
105 | S Y=X
|
---|
106 | G Y
|
---|
107 | C11 G C11S:$D(DE(11))[0 K DB
|
---|
108 | S X=DE(11),DIC=DIE
|
---|
109 | X "D SEND^ACKQUTL5(DA)"
|
---|
110 | C11S S X="" G:DG(DQ)=X C11F1 K DB
|
---|
111 | S X=DG(DQ),DIC=DIE
|
---|
112 | X "D SEND^ACKQUTL5(DA)"
|
---|
113 | C11F1 Q
|
---|
114 | X11 Q
|
---|
115 | 12 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
|
---|
116 | X12 S ACKENV=$S(ACKENV=0:0,ACKSC'=1:ACKENV,X=1:2,1:1)
|
---|
117 | Q
|
---|
118 | 13 S DQ=14 ;@100
|
---|
119 | 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
|
---|
120 | X14 I '$$MST^ACKQUTL4(ACKPCE,ACKVD,ACKPAT) S Y="@105"
|
---|
121 | Q
|
---|
122 | 15 D:$D(DG)>9 F^DIE17,DE S DQ=15,DW="2;9",DV="RS",DU="",DLB="Was care related to MST ?",DIFLD=90
|
---|
123 | S DE(DW)="C15^ACKQTE5"
|
---|
124 | S DU="1:YES;0:NO;"
|
---|
125 | S X=""
|
---|
126 | S Y=X
|
---|
127 | G Y
|
---|
128 | C15 G C15S:$D(DE(15))[0 K DB
|
---|
129 | S X=DE(15),DIC=DIE
|
---|
130 | X "D SEND^ACKQUTL5(DA)"
|
---|
131 | C15S S X="" G:DG(DQ)=X C15F1 K DB
|
---|
132 | S X=DG(DQ),DIC=DIE
|
---|
133 | X "D SEND^ACKQUTL5(DA)"
|
---|
134 | C15F1 Q
|
---|
135 | X15 Q
|
---|
136 | 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
|
---|
137 | X16 I '$$MST^ACKQUTL4(ACKPCE,ACKVD,ACKPAT) D CLEAR^ACKQUTL4(ACKVIEN,"90")
|
---|
138 | Q
|
---|
139 | 17 S DQ=18 ;@105
|
---|
140 | 18 D:$D(DG)>9 F^DIE17,DE S DQ=18,DW="2;2",DV="*P509850'",DU="",DLB="CDR ACCOUNT",DIFLD=5
|
---|
141 | S DE(DW)="C18^ACKQTE5"
|
---|
142 | S DU="ACK(509850,"
|
---|
143 | S X=$$CDR^ACKQUTL6()
|
---|
144 | S Y=X
|
---|
145 | G Y
|
---|
146 | C18 G C18S:$D(DE(18))[0 K DB
|
---|
147 | S X=DE(18),DIC=DIE
|
---|
148 | S ACKCAT=$E(^ACK(509850,X,0),1,2),ACKMO=$E(^ACK(509850.6,DA,0),1,5)_"00" S:$D(^ACK(509850.6,"ATCAT",ACKMO,ACKCAT)) $P(^(ACKCAT),U)=^(ACKCAT)-1 K:$S($D(^(ACKCAT)):'^(ACKCAT),1:0) ^(ACKCAT) K ACKCAT,ACKMO
|
---|
149 | S X=DE(18),DIC=DIE
|
---|
150 | S ACKCDR=+^ACK(509850,X,0),ACKMO=$E(^ACK(509850.6,DA,0),1,5)_"00" S:$D(^ACK(509850.6,"ATCDR",ACKMO,ACKCDR)) $P(^(ACKCDR),U)=^(ACKCDR)-1 K:$S($D(^(ACKCDR)):'^(ACKCDR),1:0) ^(ACKCDR) K ACKMO,ACKCDR
|
---|
151 | S X=DE(18),DIC=DIE
|
---|
152 | K ^ACK(509850.6,"ADCI",$E($P(^ACK(509850.6,DA,0),U),1,5)_"00",X,DA)
|
---|
153 | C18S S X="" G:DG(DQ)=X C18F1 K DB
|
---|
154 | S X=DG(DQ),DIC=DIE
|
---|
155 | S ACKCAT=$E(^ACK(509850,X,0),1,2),ACKMO=$E(^ACK(509850.6,DA,0),1,5)_"00",$P(^(ACKCAT),U)=$S($D(^ACK(509850.6,"ATCAT",ACKMO,ACKCAT)):^(ACKCAT)+1,1:1)
|
---|
156 | S X=DG(DQ),DIC=DIE
|
---|
157 | S ACKCDR=+^ACK(509850,X,0),ACKMO=$E(^ACK(509850.6,DA,0),1,5)_"00",$P(^(ACKCDR),U)=$S($D(^ACK(509850.6,"ATCDR",ACKMO,ACKCDR)):^(ACKCDR)+1,1:1) K ACKMO,ACKCDR
|
---|
158 | S X=DG(DQ),DIC=DIE
|
---|
159 | S ^ACK(509850.6,"ADCI",$E($P(^ACK(509850.6,DA,0),U),1,5)_"00",X,DA)=""
|
---|
160 | C18F1 Q
|
---|
161 | X18 S DIC("S")="I $P(^(0),U,5)=1" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
|
---|
162 | Q
|
---|
163 | ;
|
---|
164 | 19 S DQ=20 ;@110
|
---|
165 | 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
|
---|
166 | X20 S ACKAUDIO=$$AUDIO^ACKQUTL4 I 'ACKAUDIO S Y="@270"
|
---|
167 | Q
|
---|
168 | 21 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=21 D X21 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
|
---|
169 | X21 I 'ACKATS S Y="@120"
|
---|
170 | Q
|
---|
171 | 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
|
---|
172 | X22 S ACKLAMD=$$LAMD^ACKQAS1(DFN)
|
---|
173 | Q
|
---|
174 | 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
|
---|
175 | X23 I $D(DIRUT) S Y="@999"
|
---|
176 | Q
|
---|
177 | 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
|
---|
178 | X24 I ACKLAMD S Y="@265"
|
---|
179 | Q
|
---|
180 | 25 S DQ=26 ;@120
|
---|
181 | 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
|
---|
182 | X26 S ACKLAMD=ACKVD
|
---|
183 | Q
|
---|
184 | 27 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
|
---|
185 | X27 S ACKAUDIO=$$AUDIO^ACKQUTL4 I 'ACKAUDIO!($L(ACKLAMD)>7) S Y="@270"
|
---|
186 | Q
|
---|
187 | 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
|
---|
188 | X28 W !!,"Enter Audiometrics :",!
|
---|
189 | Q
|
---|
190 | 29 D:$D(DG)>9 F^DIE17 G ^ACKQTE6
|
---|