source: FOIAVistA/tag/r/QUASAR-ACKQ/ACKQTE5.m@ 1796

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

initial load of FOIAVistA 6/30/08 version

File size: 8.0 KB
Line 
1ACKQTE5 ; ;07/15/03
2 D DE G BEGIN
3DE 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 ;
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="ACKQTE5",DQ=1
531 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
59C1 G C1S:$D(DE(1))[0 K DB
60 S X=DE(1),DIC=DIE
61 X "D SEND^ACKQUTL5(DA)"
62C1S S X="" G:DG(DQ)=X C1F1 K DB
63 S X=DG(DQ),DIC=DIE
64 X "D SEND^ACKQUTL5(DA)"
65C1F1 Q
66X1 Q
672 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
68X2 S ACKAO=$S(ACKAO=0:0,ACKSC'=1:ACKAO,X=1:2,1:1)
69 Q
703 S DQ=4 ;@80
714 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
72X4 I ACKRAD=0 S Y="@90"
73 Q
745 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
75X5 I ACKSC=2 S Y="@100"
76 Q
776 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
83C6 G C6S:$D(DE(6))[0 K DB
84 S X=DE(6),DIC=DIE
85 X "D SEND^ACKQUTL5(DA)"
86C6S S X="" G:DG(DQ)=X C6F1 K DB
87 S X=DG(DQ),DIC=DIE
88 X "D SEND^ACKQUTL5(DA)"
89C6F1 Q
90X6 Q
917 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
92X7 S ACKRAD=$S(ACKRAD=0:0,ACKSC'=1:ACKRAD,X=1:2,1:1)
93 Q
948 S DQ=9 ;@90
959 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
96X9 I ACKENV=0 S Y="@100"
97 Q
9810 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
99X10 I ACKSC=2 S Y="@100"
100 Q
10111 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
107C11 G C11S:$D(DE(11))[0 K DB
108 S X=DE(11),DIC=DIE
109 X "D SEND^ACKQUTL5(DA)"
110C11S S X="" G:DG(DQ)=X C11F1 K DB
111 S X=DG(DQ),DIC=DIE
112 X "D SEND^ACKQUTL5(DA)"
113C11F1 Q
114X11 Q
11512 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
116X12 S ACKENV=$S(ACKENV=0:0,ACKSC'=1:ACKENV,X=1:2,1:1)
117 Q
11813 S DQ=14 ;@100
11914 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
120X14 I '$$MST^ACKQUTL4(ACKPCE,ACKVD,ACKPAT) S Y="@105"
121 Q
12215 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
128C15 G C15S:$D(DE(15))[0 K DB
129 S X=DE(15),DIC=DIE
130 X "D SEND^ACKQUTL5(DA)"
131C15S S X="" G:DG(DQ)=X C15F1 K DB
132 S X=DG(DQ),DIC=DIE
133 X "D SEND^ACKQUTL5(DA)"
134C15F1 Q
135X15 Q
13616 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
137X16 I '$$MST^ACKQUTL4(ACKPCE,ACKVD,ACKPAT) D CLEAR^ACKQUTL4(ACKVIEN,"90")
138 Q
13917 S DQ=18 ;@105
14018 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
146C18 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)
153C18S 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)=""
160C18F1 Q
161X18 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 ;
16419 S DQ=20 ;@110
16520 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
166X20 S ACKAUDIO=$$AUDIO^ACKQUTL4 I 'ACKAUDIO S Y="@270"
167 Q
16821 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
169X21 I 'ACKATS S Y="@120"
170 Q
17122 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
172X22 S ACKLAMD=$$LAMD^ACKQAS1(DFN)
173 Q
17423 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
175X23 I $D(DIRUT) S Y="@999"
176 Q
17724 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
178X24 I ACKLAMD S Y="@265"
179 Q
18025 S DQ=26 ;@120
18126 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
182X26 S ACKLAMD=ACKVD
183 Q
18427 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
185X27 S ACKAUDIO=$$AUDIO^ACKQUTL4 I 'ACKAUDIO!($L(ACKLAMD)>7) S Y="@270"
186 Q
18728 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
188X28 W !!,"Enter Audiometrics :",!
189 Q
19029 D:$D(DG)>9 F^DIE17 G ^ACKQTE6
Note: See TracBrowser for help on using the repository browser.