ACKQTE6 ; ;11/10/10
D DE G BEGIN
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,""))=""
I $D(^(2)) S %Z=^(2) S %=$P(%Z,U,2) S:%]"" DE(16)=% S %=$P(%Z,U,9) S:%]"" DE(13)=%
I $D(^(4)) S %Z=^(4) S %=$P(%Z,U,1) S:%]"" DE(27)=% S %=$P(%Z,U,2) S:%]"" DE(30)=% S %=$P(%Z,U,3) S:%]"" DE(33)=% S %=$P(%Z,U,4) S:%]"" DE(36)=% S %=$P(%Z,U,5) S:%]"" DE(39)=% S %=$P(%Z,U,7) S:%]"" DE(42)=% S %=$P(%Z,U,8) S:%]"" DE(45)=%
I S %=$P(%Z,U,9) S:%]"" DE(48)=% S %=$P(%Z,U,10) S:%]"" DE(51)=% S %=$P(%Z,U,11) S:%]"" DE(54)=% S %=$P(%Z,U,13) S:%]"" DE(57)=% S %=$P(%Z,U,14) S:%]"" DE(60)=% S %=$P(%Z,U,15) S:%]"" DE(63)=% S %=$P(%Z,U,16) S:%]"" DE(66)=%
I S %=$P(%Z,U,23) S:%]"" DE(68)=%
I $D(^(5)) S %Z=^(5) S %=$P(%Z,U,6) S:%]"" DE(1)=% S %=$P(%Z,U,9) S:%]"" DE(5)=% S %=$P(%Z,U,10) S:%]"" DE(9)=%
K %Z Q
;
W W !?DL+DL-2,DLB_": "
Q
O D W W Y W:$X>45 !?9
I $L(Y)>19,'DV,DV'["I",(DV["F"!(DV["K")) G RW^DIR2
W:Y]"" "// " I 'DV,DV["I",$D(DE(DQ))#2 S X="" W " (No Editing)" Q
TR R X:DTIME E S (DTOUT,X)=U W $C(7)
Q
A K DQ(DQ) S DQ=DQ+1
B G @DQ
RE G PR:$D(DE(DQ)) D W,TR
N I X="" G NKEY:$D(^DD("KEY","F",DP,DIFLD)),A:DV'["R",X:'DV,X:D'>0,A
RD G QS:X?."?" I X["^" D D G ^DIE17
I X="@" D D G Z^DIE2
I X=" ",DV["d",DV'["P",$D(^DISV(DUZ,"DIE",DLB)) S X=^(DLB) I DV'["D",DV'["S" W " "_X
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
K DDER G X
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
G V:DV'["N" D D I $L($P(X,"."))>24 K X G Z
I $P(DQ(DQ),U,5)'["$",X?.1"-".N.1".".N,$P(DQ(DQ),U,5,99)["+X'=X" S X=+X
V D @("X"_DQ) K YS
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
X W:'$D(ZTQUEUED) $C(7),"??" I $D(DB(DQ)) G Z^DIE17
S X="?BAD"
QS S DZ=X D D,QQ^DIEQ G B
D S D=DIFLD,DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$P($T(@("X"_DQ))," ",2,99) Q
Y I '$D(DE(DQ)) D O G RD:"@"'[X,A:DV'["R"&(X="@"),X:X="@" S X=Y G N
PR S DG=DV,Y=DE(DQ),X=DU I $D(DQ(DQ,2)) X DQ(DQ,2) G RP
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
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
X:DG["D" ^DD("DD") I DG["S" S %=$P($P(";"_X,";"_Y_":",2),";") S:%]"" Y=%
RP D O I X="" S X=DE(DQ) G A:'DV,A:DC<2,N^DIE17
I I DV'["I",DV'["#" G RD
D E^DIE0 G RD:$D(X),PR
Q
SET N DIR S DIR(0)="SV"_$E("o",$D(DB(DQ)))_U_DU,DIR("V")=1
I $D(DB(DQ)),'$D(DIQUIET) N DIQUIET S DIQUIET=1
D ^DIR I 'DDER S %=Y(0),X=Y
Q
SAVEVALS S @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$G(DE(DQ)) S:$D(^("F"))[0 ^("F")=$G(DE(DQ))
I $D(DE(DW,"4/")) S @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""
E K @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")
Q
NKEY W:'$D(ZTQUEUED) "?? Required key field" S X="?BAD" G QS
KEYCHK() Q:$G(DE(DW,"KEY"))="" 1 Q @DE(DW,"KEY")
BEGIN S DNM="ACKQTE6",DQ=1
1 D:$D(DG)>9 F^DIE17,DE S DQ=1,DW="5;6",DV="RS",DU="",DLB="Was care related to EC Exposure ?",DIFLD=35
S DE(DW)="C1^ACKQTE6"
S DU="0:NO;1:YES;"
S X=""
S Y=X
G Y
C1 G C1S:$D(DE(1))[0 K DB
S X=DE(1),DIC=DIE
X "D SEND^ACKQUTL5(DA)"
C1S S X="" G:DG(DQ)=X C1F1 K DB
S X=DG(DQ),DIC=DIE
X "D SEND^ACKQUTL5(DA)"
C1F1 Q
X1 Q
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
X2 S ACKENV=$S(ACKENV=0:0,ACKSC'=1:ACKENV,X=1:2,1:1)
Q
3 S DQ=4 ;@90
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
X4 I ACKHNC=0 S Y="@95"
Q
5 D:$D(DG)>9 F^DIE17,DE S DQ=5,DW="5;9",DV="RS",DU="",DLB="Was care related to Head and/or Neck Cancer ?",DIFLD=40
S DU="0:NO;1:YES;"
S X=""
S Y=X
G Y
X5 Q
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
X6 S ACKHNC=$S(ACKHNC=0:0,ACKSC'=1:ACKHNC,X=1:2,1:1)
Q
7 S DQ=8 ;@95
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
X8 I ACKCV=0 S Y="@100"
Q
9 S DW="5;10",DV="RS",DU="",DLB="Was care related to COMBAT ?",DIFLD=45
S DU="0:NO;1:YES;"
S X="YES"
S Y=X
G Y
X9 Q
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
X10 S ACKCV=$S(ACKCV=0:0,ACKSC'=1:ACKCV,X=1:2,1:1)
Q
11 S DQ=12 ;@100
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
X12 I '$$MST^ACKQUTL4(ACKPCE,ACKVD,ACKPAT) S Y="@105"
Q
13 S DW="2;9",DV="RS",DU="",DLB="Was care related to MST ?",DIFLD=90
S DE(DW)="C13^ACKQTE6"
S DU="1:YES;0:NO;"
S X=""
S Y=X
G Y
C13 G C13S:$D(DE(13))[0 K DB
S X=DE(13),DIC=DIE
X "D SEND^ACKQUTL5(DA)"
C13S S X="" G:DG(DQ)=X C13F1 K DB
S X=DG(DQ),DIC=DIE
X "D SEND^ACKQUTL5(DA)"
C13F1 Q
X13 Q
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
X14 I '$$MST^ACKQUTL4(ACKPCE,ACKVD,ACKPAT) D CLEAR^ACKQUTL4(ACKVIEN,"90")
Q
15 S DQ=16 ;@105
16 D:$D(DG)>9 F^DIE17,DE S DQ=16,DW="2;2",DV="*P509850'",DU="",DLB="CDR ACCOUNT",DIFLD=5
S DE(DW)="C16^ACKQTE6"
S DU="ACK(509850,"
S X=$$CDR^ACKQUTL6()
S Y=X
G Y
C16 G C16S:$D(DE(16))[0 K DB
S X=DE(16),DIC=DIE
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
S X=DE(16),DIC=DIE
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
S X=DE(16),DIC=DIE
K ^ACK(509850.6,"ADCI",$E($P(^ACK(509850.6,DA,0),U),1,5)_"00",X,DA)
C16S S X="" G:DG(DQ)=X C16F1 K DB
S X=DG(DQ),DIC=DIE
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)
S X=DG(DQ),DIC=DIE
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
S X=DG(DQ),DIC=DIE
S ^ACK(509850.6,"ADCI",$E($P(^ACK(509850.6,DA,0),U),1,5)_"00",X,DA)=""
C16F1 Q
X16 S DIC("S")="I $P(^(0),U,5)=1" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
Q
;
17 S DQ=18 ;@110
18 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=18 D X18 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
X18 S ACKAUDIO=$$AUDIO^ACKQUTL4 I 'ACKAUDIO S Y="@270"
Q
19 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=19 D X19 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
X19 I 'ACKATS S Y="@120"
Q
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
X20 S ACKLAMD=$$LAMD^ACKQAS1(DFN)
Q
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
X21 I $D(DIRUT) S Y="@999"
Q
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
X22 I ACKLAMD S Y="@265"
Q
23 S DQ=24 ;@120
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
X24 S ACKLAMD=ACKVD
Q
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
X25 S ACKAUDIO=$$AUDIO^ACKQUTL4 I 'ACKAUDIO!($L(ACKLAMD)>7) S Y="@270"
Q
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
X26 W !!,"Enter Audiometrics :",!
Q
27 D:$D(DG)>9 F^DIE17,DE S DQ=27,DW="4;1",DV="RNJ3,0",DU="",DLB="TONE R500",DIFLD=4.01
S DE(DW)="C27^ACKQTE6"
G RE
C27 G C27S:$D(DE(27))[0 K DB
S X=DE(27),DIC=DIE
S X1=^ACK(509850.6,DA,0) K ^ACK(509850.6,"AMD",+$P(X1,U,2),9999999-$P(X1,U),DA),X1
C27S S X="" G:DG(DQ)=X C27F1 K DB
S X=DG(DQ),DIC=DIE
S X1=^ACK(509850.6,DA,0) S:'$D(ACKNAMD) ^ACK(509850.6,"AMD",+$P(X1,U,2),9999999-$P(X1,U),DA)="" K X1
C27F1 Q
X27 K:+X'=X!(X>105)!(X<-10)!(X?.E1"."1N.N) X
Q
;
28 S DQ=29 ;@130
29 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=29 D X29 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
X29 S ACKAUDIO=$$AUDIO^ACKQUTL4 I 'ACKAUDIO!($L(ACKLAMD)>7) S Y="@270"
Q
30 D:$D(DG)>9 F^DIE17,DE S DQ=30,DW="4;2",DV="RNJ3,0",DU="",DLB="TONE R1000",DIFLD=4.02
G RE
X30 K:+X'=X!(X>105)!(X<-10)!(X?.E1"."1N.N) X
Q
;
31 S DQ=32 ;@140
32 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=32 D X32 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
X32 S ACKAUDIO=$$AUDIO^ACKQUTL4 I 'ACKAUDIO!($L(ACKLAMD)>7) S Y="@270"
Q
33 S DW="4;3",DV="RNJ3,0",DU="",DLB="TONE R2000",DIFLD=4.03
G RE
X33 K:+X'=X!(X>105)!(X<-10)!(X?.E1"."1N.N) X
Q
;
34 S DQ=35 ;@150
35 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=35 D X35 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
X35 S ACKAUDIO=$$AUDIO^ACKQUTL4 I 'ACKAUDIO!($L(ACKLAMD)>7) S Y="@270"
Q
36 S DW="4;4",DV="RNJ3,0",DU="",DLB="TONE R3000",DIFLD=4.04
G RE
X36 K:+X'=X!(X>105)!(X<-10)!(X?.E1"."1N.N) X
Q
;
37 S DQ=38 ;@160
38 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=38 D X38 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
X38 S ACKAUDIO=$$AUDIO^ACKQUTL4 I 'ACKAUDIO!($L(ACKLAMD)>7) S Y="@270"
Q
39 S DW="4;5",DV="RNJ3,0",DU="",DLB="TONE R4000",DIFLD=4.05
G RE
X39 K:+X'=X!(X>105)!(X<-10)!(X?.E1"."1N.N) X
Q
;
40 S DQ=41 ;@170
41 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=41 D X41 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
X41 S ACKAUDIO=$$AUDIO^ACKQUTL4 I 'ACKAUDIO!($L(ACKLAMD)>7) S Y="@270"
Q
42 S DW="4;7",DV="RNJ3,0",DU="",DLB="TONE L500",DIFLD=4.07
G RE
X42 K:+X'=X!(X>105)!(X<-10)!(X?.E1"."1N.N) X
Q
;
43 S DQ=44 ;@180
44 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=44 D X44 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
X44 S ACKAUDIO=$$AUDIO^ACKQUTL4 I 'ACKAUDIO!($L(ACKLAMD)>7) S Y="@270"
Q
45 S DW="4;8",DV="RNJ3,0",DU="",DLB="TONE L1000",DIFLD=4.08
G RE
X45 K:+X'=X!(X>105)!(X<-10)!(X?.E1"."1N.N) X
Q
;
46 S DQ=47 ;@190
47 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=47 D X47 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
X47 S ACKAUDIO=$$AUDIO^ACKQUTL4 I 'ACKAUDIO!($L(ACKLAMD)>7) S Y="@270"
Q
48 S DW="4;9",DV="RNJ3,0",DU="",DLB="TONE L2000",DIFLD=4.09
G RE
X48 K:+X'=X!(X>105)!(X<-10)!(X?.E1"."1N.N) X
Q
;
49 S DQ=50 ;@200
50 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=50 D X50 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
X50 S ACKAUDIO=$$AUDIO^ACKQUTL4 I 'ACKAUDIO!($L(ACKLAMD)>7) S Y="@270"
Q
51 S DW="4;10",DV="RNJ3,0",DU="",DLB="TONE L3000",DIFLD=4.1
G RE
X51 K:+X'=X!(X>105)!(X<-10)!(X?.E1"."1N.N) X
Q
;
52 S DQ=53 ;@210
53 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=53 D X53 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
X53 S ACKAUDIO=$$AUDIO^ACKQUTL4 I 'ACKAUDIO!($L(ACKLAMD)>7) S Y="@270"
Q
54 S DW="4;11",DV="RNJ3,0",DU="",DLB="TONE L4000",DIFLD=4.11
G RE
X54 K:+X'=X!(X>105)!(X<-10)!(X?.E1"."1N.N) X
Q
;
55 S DQ=56 ;@230
56 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=56 D X56 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
X56 S ACKAUDIO=$$AUDIO^ACKQUTL4 I 'ACKAUDIO!($L(ACKLAMD)>7) S Y="@270"
Q
57 S DW="4;13",DV="NJ3,0",DU="",DLB="CNC R",DIFLD=4.13
G RE
X57 K:+X'=X!(X>100)!(X<0)!(X?.E1"."1N.N) X
Q
;
58 S DQ=59 ;@240
59 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=59 D X59 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
X59 S ACKAUDIO=$$AUDIO^ACKQUTL4 I 'ACKAUDIO!($L(ACKLAMD)>7) S Y="@270"
Q
60 S DW="4;14",DV="NJ3,0",DU="",DLB="CNC L",DIFLD=4.14
G RE
X60 K:+X'=X!(X>100)!(X<0)!(X?.E1"."1N.N) X
Q
;
61 S DQ=62 ;@250
62 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=62 D X62 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
X62 S ACKAUDIO=$$AUDIO^ACKQUTL4 I 'ACKAUDIO!($L(ACKLAMD)>7) S Y="@270"
Q
63 S DW="4;15",DV="NJ3,0",DU="",DLB="W22 R",DIFLD=4.15
G RE
X63 K:+X'=X!(X>100)!(X<0)!(X?.E1"."1N.N) X
Q
;
64 S DQ=65 ;@260
65 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=65 D X65 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
X65 S ACKAUDIO=$$AUDIO^ACKQUTL4 I 'ACKAUDIO!($L(ACKLAMD)>7) S Y="@270"
Q
66 S DW="4;16",DV="NJ3,0",DU="",DLB="W22 L",DIFLD=4.16
G RE
X66 K:+X'=X!(X>100)!(X<0)!(X?.E1"."1N.N) X
Q
;
67 S DQ=68 ;@265
68 S DW="4;23",DV="D",DU="",DLB="DATE OF AUDIOMETRIC TESTING",DIFLD=4.23
G RE
X68 S %DT="EX" D ^%DT S X=Y K:Y<1 X
Q
;
69 S DQ=70 ;@270
70 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=70 D X70 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
X70 I ACKCP'=1 S Y="@320"
Q
71 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=71 D X71 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
X71 S ACKQHLP="^509850.6^100" D ^ACKQHLP
Q
72 S D=0 K DE(1) ;100
S Y="REVIEW OF MEDICAL RECORDS^W^^0;1^Q",DG="100",DC="^509850.62" D DIEN^DIWE K DE(1) G A
;
73 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=73 D X73 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
X73 I $D(DIRUT) S Y="@999"
Q
74 S DQ=75 ;@280
75 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=75 D X75 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
X75 I ACKCP'=1 S Y="@320"
Q
76 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=76 D X76 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
X76 S ACKQHLP="^509850.6^101" D ^ACKQHLP
Q
77 D:$D(DG)>9 F^DIE17 G ^ACKQTE7
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HACKQTE6 14225 printed Nov 22, 2024@17:42:44 Page 2
ACKQTE6 ; ;11/10/10
+1 DO DE
GOTO BEGIN
DE SET DIE="^ACK(509850.6,"
SET DIC=DIE
SET DP=509850.6
SET DL=1
SET DIEL=0
SET DU=""
KILL DG,DE,DB
if $ORDER(^ACK(509850.6,DA,""))=""
QUIT
+1 IF $DATA(^(2))
SET %Z=^(2)
SET %=$PIECE(%Z,U,2)
if %]""
SET DE(16)=%
SET %=$PIECE(%Z,U,9)
if %]""
SET DE(13)=%
+2 IF $DATA(^(4))
SET %Z=^(4)
SET %=$PIECE(%Z,U,1)
if %]""
SET DE(27)=%
SET %=$PIECE(%Z,U,2)
if %]""
SET DE(30)=%
SET %=$PIECE(%Z,U,3)
if %]""
SET DE(33)=%
SET %=$PIECE(%Z,U,4)
if %]""
SET DE(36)=%
SET %=$PIECE(%Z,U,5)
if %]""
SET DE(39)=%
SET %=$PIECE(%Z,U,7)
if %]""
SET DE(42)=%
SET %=$PIECE(%Z,U,8)
if %]""
SET DE(45)=%
+3 IF $TEST
SET %=$PIECE(%Z,U,9)
if %]""
SET DE(48)=%
SET %=$PIECE(%Z,U,10)
if %]""
SET DE(51)=%
SET %=$PIECE(%Z,U,11)
if %]""
SET DE(54)=%
SET %=$PIECE(%Z,U,13)
if %]""
SET DE(57)=%
SET %=$PIECE(%Z,U,14)
if %]""
SET DE(60)=%
SET %=$PIECE(%Z,U,15)
if %]""
SET DE(63)=%
SET %=$PIECE(%Z,U,16)
if %]""
SET DE(66)=%
+4 IF $TEST
SET %=$PIECE(%Z,U,23)
if %]""
SET DE(68)=%
+5 IF $DATA(^(5))
SET %Z=^(5)
SET %=$PIECE(%Z,U,6)
if %]""
SET DE(1)=%
SET %=$PIECE(%Z,U,9)
if %]""
SET DE(5)=%
SET %=$PIECE(%Z,U,10)
if %]""
SET DE(9)=%
+6 KILL %Z
QUIT
+7 ;
W WRITE !?DL+DL-2,DLB_": "
+1 QUIT
O DO W
WRITE Y
if $X>45
WRITE !?9
+1 IF $LENGTH(Y)>19
IF 'DV
IF DV'["I"
IF (DV["F"!(DV["K"))
GOTO RW^DIR2
+2 if Y]""
WRITE "// "
IF 'DV
IF DV["I"
IF $DATA(DE(DQ))#2
SET X=""
WRITE " (No Editing)"
QUIT
TR READ X:DTIME
IF '$TEST
SET (DTOUT,X)=U
WRITE $CHAR(7)
+1 QUIT
A KILL DQ(DQ)
SET DQ=DQ+1
B GOTO @DQ
RE if $DATA(DE(DQ))
GOTO PR
DO W
DO TR
N IF X=""
if $DATA(^DD("KEY","F",DP,DIFLD))
GOTO NKEY
if DV'["R"
GOTO A
if 'DV
GOTO X
if D'>0
GOTO X
GOTO A
RD if X?."?"
GOTO QS
IF X["^"
DO D
GOTO ^DIE17
+1 IF X="@"
DO D
GOTO Z^DIE2
+2 IF X=" "
IF DV["d"
IF DV'["P"
IF $DATA(^DISV(DUZ,"DIE",DLB))
SET X=^(DLB)
IF DV'["D"
IF DV'["S"
WRITE " "_X
T if DV
GOTO M^DIE17
if DV["V"
GOTO ^DIE3
if DV'["S"
GOTO P
if $DATA(^DD(DP,DIFLD,12.1))
XECUTE ^(12.1)
IF X?.ANP
DO SET
IF 'DDER
if $DATA(DIC("S"))
XECUTE DIC("S")
IF $TEST
if '$DATA(DB(DQ))
WRITE " "_%
GOTO V
+1 KILL DDER
GOTO X
P IF DV["P"
SET DIC=U_DU
SET DIC(0)=$EXTRACT("EN",$DATA(DB(DQ))+1)_"M"_$EXTRACT("L",DV'["'")
if DIC(0)["L"
SET DLAYGO=+$PIECE(DV,"P",2)
if DV["*"
GOTO AST^DIED
DO NOSCR^DIED
SET X=+Y
SET DIC=DIE
if X<0
GOTO X
+1 if DV'["N"
GOTO V
DO D
IF $LENGTH($PIECE(X,"."))>24
KILL X
GOTO Z
+2 IF $PIECE(DQ(DQ),U,5)'["$"
IF X?.1"-".N.1".".N
IF $PIECE(DQ(DQ),U,5,99)["+X'=X"
SET X=+X
V DO @("X"_DQ)
KILL YS
Z KILL DIC("S"),DLAYGO
IF $DATA(X)
IF X'=U
if $GET(DE(DW,"INDEX"))
DO SAVEVALS
if '$$KEYCHK
GOTO UNIQFERR^DIE17
SET DG(DW)=X
if DV["d"
SET ^DISV(DUZ,"DIE",DLB)=X
GOTO A
X if '$DATA(ZTQUEUED)
WRITE $CHAR(7),"??"
IF $DATA(DB(DQ))
GOTO Z^DIE17
+1 SET X="?BAD"
QS SET DZ=X
DO D
DO QQ^DIEQ
GOTO B
D SET D=DIFLD
SET DQ(DQ)=DLB_U_DV_U_DU_U_DW_U_$PIECE($TEXT(@("X"_DQ))," ",2,99)
QUIT
Y IF '$DATA(DE(DQ))
DO O
if "@"'[X
GOTO RD
if DV'["R"&(X="@")
GOTO A
if X="@"
GOTO X
SET X=Y
GOTO N
PR SET DG=DV
SET Y=DE(DQ)
SET X=DU
IF $DATA(DQ(DQ,2))
XECUTE DQ(DQ,2)
GOTO RP
R IF DG["P"
IF @("$D(^"_X_"0))")
SET X=+$PIECE(^(0),U,2)
if '$DATA(^(Y,0))
GOTO RP
SET Y=$PIECE(^(0),U)
SET X=$PIECE(^DD(X,.01,0),U,3)
SET DG=$PIECE(^(0),U,2)
GOTO R
+1 IF DG["V"
IF +Y
IF $PIECE(Y,";",2)["("
IF $DATA(@(U_$PIECE(Y,";",2)_"0)"))
SET X=+$PIECE(^(0),U,2)
if '$DATA(^(+Y,0))
GOTO RP
SET Y=$PIECE(^(0),U)
IF $DATA(^DD(+X,.01,0))
SET DG=$PIECE(^(0),U,2)
SET X=$PIECE(^(0),U,3)
GOTO R
+2 if DG["D"
XECUTE ^DD("DD")
IF DG["S"
SET %=$PIECE($PIECE(";"_X,";"_Y_":",2),";")
if %]""
SET Y=%
RP DO O
IF X=""
SET X=DE(DQ)
if 'DV
GOTO A
if DC<2
GOTO A
GOTO N^DIE17
I IF DV'["I"
IF DV'["#"
GOTO RD
+1 DO E^DIE0
if $DATA(X)
GOTO RD
GOTO PR
+2 QUIT
SET NEW DIR
SET DIR(0)="SV"_$EXTRACT("o",$DATA(DB(DQ)))_U_DU
SET DIR("V")=1
+1 IF $DATA(DB(DQ))
IF '$DATA(DIQUIET)
NEW DIQUIET
SET DIQUIET=1
+2 DO ^DIR
IF 'DDER
SET %=Y(0)
SET X=Y
+3 QUIT
SAVEVALS SET @DIEZTMP@("V",DP,DIIENS,DIFLD,"O")=$GET(DE(DQ))
if $DATA(^("F"))[0
SET ^("F")=$GET(DE(DQ))
+1 IF $DATA(DE(DW,"4/"))
SET @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")=""
+2 IF '$TEST
KILL @DIEZTMP@("V",DP,DIIENS,DIFLD,"4/")
+3 QUIT
NKEY if '$DATA(ZTQUEUED)
WRITE "?? Required key field"
SET X="?BAD"
GOTO QS
KEYCHK() if $GET(DE(DW,"KEY"))=""
QUIT 1
QUIT @DE(DW,"KEY")
BEGIN SET DNM="ACKQTE6"
SET DQ=1
1 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=1
SET DW="5;6"
SET DV="RS"
SET DU=""
SET DLB="Was care related to EC Exposure ?"
SET DIFLD=35
+1 SET DE(DW)="C1^ACKQTE6"
+2 SET DU="0:NO;1:YES;"
+3 SET X=""
+4 SET Y=X
+5 GOTO Y
C1 if $DATA(DE(1))[0
GOTO C1S
KILL DB
+1 SET X=DE(1)
SET DIC=DIE
+2 XECUTE "D SEND^ACKQUTL5(DA)"
C1S SET X=""
if DG(DQ)=X
GOTO C1F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 XECUTE "D SEND^ACKQUTL5(DA)"
C1F1 QUIT
X1 QUIT
2 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=2
DO X2
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X2 SET ACKENV=$SELECT(ACKENV=0:0,ACKSC'=1:ACKENV,X=1:2,1:1)
+1 QUIT
3 ;@90
SET DQ=4
4 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=4
DO X4
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X4 IF ACKHNC=0
SET Y="@95"
+1 QUIT
5 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=5
SET DW="5;9"
SET DV="RS"
SET DU=""
SET DLB="Was care related to Head and/or Neck Cancer ?"
SET DIFLD=40
+1 SET DU="0:NO;1:YES;"
+2 SET X=""
+3 SET Y=X
+4 GOTO Y
X5 QUIT
6 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=6
DO X6
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X6 SET ACKHNC=$SELECT(ACKHNC=0:0,ACKSC'=1:ACKHNC,X=1:2,1:1)
+1 QUIT
7 ;@95
SET DQ=8
8 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=8
DO X8
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X8 IF ACKCV=0
SET Y="@100"
+1 QUIT
9 SET DW="5;10"
SET DV="RS"
SET DU=""
SET DLB="Was care related to COMBAT ?"
SET DIFLD=45
+1 SET DU="0:NO;1:YES;"
+2 SET X="YES"
+3 SET Y=X
+4 GOTO Y
X9 QUIT
10 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=10
DO X10
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X10 SET ACKCV=$SELECT(ACKCV=0:0,ACKSC'=1:ACKCV,X=1:2,1:1)
+1 QUIT
11 ;@100
SET DQ=12
12 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=12
DO X12
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X12 IF '$$MST^ACKQUTL4(ACKPCE,ACKVD,ACKPAT)
SET Y="@105"
+1 QUIT
13 SET DW="2;9"
SET DV="RS"
SET DU=""
SET DLB="Was care related to MST ?"
SET DIFLD=90
+1 SET DE(DW)="C13^ACKQTE6"
+2 SET DU="1:YES;0:NO;"
+3 SET X=""
+4 SET Y=X
+5 GOTO Y
C13 if $DATA(DE(13))[0
GOTO C13S
KILL DB
+1 SET X=DE(13)
SET DIC=DIE
+2 XECUTE "D SEND^ACKQUTL5(DA)"
C13S SET X=""
if DG(DQ)=X
GOTO C13F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 XECUTE "D SEND^ACKQUTL5(DA)"
C13F1 QUIT
X13 QUIT
14 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=14
DO X14
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X14 IF '$$MST^ACKQUTL4(ACKPCE,ACKVD,ACKPAT)
DO CLEAR^ACKQUTL4(ACKVIEN,"90")
+1 QUIT
15 ;@105
SET DQ=16
16 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=16
SET DW="2;2"
SET DV="*P509850'"
SET DU=""
SET DLB="CDR ACCOUNT"
SET DIFLD=5
+1 SET DE(DW)="C16^ACKQTE6"
+2 SET DU="ACK(509850,"
+3 SET X=$$CDR^ACKQUTL6()
+4 SET Y=X
+5 GOTO Y
C16 if $DATA(DE(16))[0
GOTO C16S
KILL DB
+1 SET X=DE(16)
SET DIC=DIE
+2 SET ACKCAT=$EXTRACT(^ACK(509850,X,0),1,2)
SET ACKMO=$EXTRACT(^ACK(509850.6,DA,0),1,5)_"00"
if $DATA(^ACK(509850.6,"ATCAT",ACKMO,ACKCAT))
SET $PIECE(^(ACKCAT),U)=^(ACKCAT)-1
if $SELECT($DATA(^(ACKCAT))
KILL ^(ACKCAT)
KILL ACKCAT,ACKMO
+3 SET X=DE(16)
SET DIC=DIE
+4 SET ACKCDR=+^ACK(509850,X,0)
SET ACKMO=$EXTRACT(^ACK(509850.6,DA,0),1,5)_"00"
if $DATA(^ACK(509850.6,"ATCDR",ACKMO,ACKCDR))
SET $PIECE(^(ACKCDR),U)=^(ACKCDR)-1
if $SELECT($DATA(^(ACKCDR))
KILL ^(ACKCDR)
KILL ACKMO,ACKCDR
+5 SET X=DE(16)
SET DIC=DIE
+6 KILL ^ACK(509850.6,"ADCI",$EXTRACT($PIECE(^ACK(509850.6,DA,0),U),1,5)_"00",X,DA)
C16S SET X=""
if DG(DQ)=X
GOTO C16F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 SET ACKCAT=$EXTRACT(^ACK(509850,X,0),1,2)
SET ACKMO=$EXTRACT(^ACK(509850.6,DA,0),1,5)_"00"
SET $PIECE(^(ACKCAT),U)=$SELECT($DATA(^ACK(509850.6,"ATCAT",ACKMO,ACKCAT)):^(ACKCAT)+1,1:1)
+3 SET X=DG(DQ)
SET DIC=DIE
+4 SET ACKCDR=+^ACK(509850,X,0)
SET ACKMO=$EXTRACT(^ACK(509850.6,DA,0),1,5)_"00"
SET $PIECE(^(ACKCDR),U)=$SELECT($DATA(^ACK(509850.6,"ATCDR",ACKMO,ACKCDR)):^(ACKCDR)+1,1:1)
KILL ACKMO,ACKCDR
+5 SET X=DG(DQ)
SET DIC=DIE
+6 SET ^ACK(509850.6,"ADCI",$EXTRACT($PIECE(^ACK(509850.6,DA,0),U),1,5)_"00",X,DA)=""
C16F1 QUIT
X16 SET DIC("S")="I $P(^(0),U,5)=1"
DO ^DIC
KILL DIC
SET DIC=DIE
SET X=+Y
if Y<0
KILL X
+1 QUIT
+2 ;
17 ;@110
SET DQ=18
18 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=18
DO X18
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X18 SET ACKAUDIO=$$AUDIO^ACKQUTL4
IF 'ACKAUDIO
SET Y="@270"
+1 QUIT
19 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=19
DO X19
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X19 IF 'ACKATS
SET Y="@120"
+1 QUIT
20 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=20
DO X20
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X20 SET ACKLAMD=$$LAMD^ACKQAS1(DFN)
+1 QUIT
21 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=21
DO X21
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X21 IF $DATA(DIRUT)
SET Y="@999"
+1 QUIT
22 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=22
DO X22
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X22 IF ACKLAMD
SET Y="@265"
+1 QUIT
23 ;@120
SET DQ=24
24 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=24
DO X24
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X24 SET ACKLAMD=ACKVD
+1 QUIT
25 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=25
DO X25
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X25 SET ACKAUDIO=$$AUDIO^ACKQUTL4
IF 'ACKAUDIO!($LENGTH(ACKLAMD)>7)
SET Y="@270"
+1 QUIT
26 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=26
DO X26
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X26 WRITE !!,"Enter Audiometrics :",!
+1 QUIT
27 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=27
SET DW="4;1"
SET DV="RNJ3,0"
SET DU=""
SET DLB="TONE R500"
SET DIFLD=4.01
+1 SET DE(DW)="C27^ACKQTE6"
+2 GOTO RE
C27 if $DATA(DE(27))[0
GOTO C27S
KILL DB
+1 SET X=DE(27)
SET DIC=DIE
+2 SET X1=^ACK(509850.6,DA,0)
KILL ^ACK(509850.6,"AMD",+$PIECE(X1,U,2),9999999-$PIECE(X1,U),DA),X1
C27S SET X=""
if DG(DQ)=X
GOTO C27F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 SET X1=^ACK(509850.6,DA,0)
if '$DATA(ACKNAMD)
SET ^ACK(509850.6,"AMD",+$PIECE(X1,U,2),9999999-$PIECE(X1,U),DA)=""
KILL X1
C27F1 QUIT
X27 if +X'=X!(X>105)!(X<-10)!(X?.E1"."1N.N)
KILL X
+1 QUIT
+2 ;
28 ;@130
SET DQ=29
29 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=29
DO X29
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X29 SET ACKAUDIO=$$AUDIO^ACKQUTL4
IF 'ACKAUDIO!($LENGTH(ACKLAMD)>7)
SET Y="@270"
+1 QUIT
30 if $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=30
SET DW="4;2"
SET DV="RNJ3,0"
SET DU=""
SET DLB="TONE R1000"
SET DIFLD=4.02
+1 GOTO RE
X30 if +X'=X!(X>105)!(X<-10)!(X?.E1"."1N.N)
KILL X
+1 QUIT
+2 ;
31 ;@140
SET DQ=32
32 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=32
DO X32
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X32 SET ACKAUDIO=$$AUDIO^ACKQUTL4
IF 'ACKAUDIO!($LENGTH(ACKLAMD)>7)
SET Y="@270"
+1 QUIT
33 SET DW="4;3"
SET DV="RNJ3,0"
SET DU=""
SET DLB="TONE R2000"
SET DIFLD=4.03
+1 GOTO RE
X33 if +X'=X!(X>105)!(X<-10)!(X?.E1"."1N.N)
KILL X
+1 QUIT
+2 ;
34 ;@150
SET DQ=35
35 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=35
DO X35
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X35 SET ACKAUDIO=$$AUDIO^ACKQUTL4
IF 'ACKAUDIO!($LENGTH(ACKLAMD)>7)
SET Y="@270"
+1 QUIT
36 SET DW="4;4"
SET DV="RNJ3,0"
SET DU=""
SET DLB="TONE R3000"
SET DIFLD=4.04
+1 GOTO RE
X36 if +X'=X!(X>105)!(X<-10)!(X?.E1"."1N.N)
KILL X
+1 QUIT
+2 ;
37 ;@160
SET DQ=38
38 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=38
DO X38
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X38 SET ACKAUDIO=$$AUDIO^ACKQUTL4
IF 'ACKAUDIO!($LENGTH(ACKLAMD)>7)
SET Y="@270"
+1 QUIT
39 SET DW="4;5"
SET DV="RNJ3,0"
SET DU=""
SET DLB="TONE R4000"
SET DIFLD=4.05
+1 GOTO RE
X39 if +X'=X!(X>105)!(X<-10)!(X?.E1"."1N.N)
KILL X
+1 QUIT
+2 ;
40 ;@170
SET DQ=41
41 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=41
DO X41
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X41 SET ACKAUDIO=$$AUDIO^ACKQUTL4
IF 'ACKAUDIO!($LENGTH(ACKLAMD)>7)
SET Y="@270"
+1 QUIT
42 SET DW="4;7"
SET DV="RNJ3,0"
SET DU=""
SET DLB="TONE L500"
SET DIFLD=4.07
+1 GOTO RE
X42 if +X'=X!(X>105)!(X<-10)!(X?.E1"."1N.N)
KILL X
+1 QUIT
+2 ;
43 ;@180
SET DQ=44
44 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=44
DO X44
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X44 SET ACKAUDIO=$$AUDIO^ACKQUTL4
IF 'ACKAUDIO!($LENGTH(ACKLAMD)>7)
SET Y="@270"
+1 QUIT
45 SET DW="4;8"
SET DV="RNJ3,0"
SET DU=""
SET DLB="TONE L1000"
SET DIFLD=4.08
+1 GOTO RE
X45 if +X'=X!(X>105)!(X<-10)!(X?.E1"."1N.N)
KILL X
+1 QUIT
+2 ;
46 ;@190
SET DQ=47
47 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=47
DO X47
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X47 SET ACKAUDIO=$$AUDIO^ACKQUTL4
IF 'ACKAUDIO!($LENGTH(ACKLAMD)>7)
SET Y="@270"
+1 QUIT
48 SET DW="4;9"
SET DV="RNJ3,0"
SET DU=""
SET DLB="TONE L2000"
SET DIFLD=4.09
+1 GOTO RE
X48 if +X'=X!(X>105)!(X<-10)!(X?.E1"."1N.N)
KILL X
+1 QUIT
+2 ;
49 ;@200
SET DQ=50
50 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=50
DO X50
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X50 SET ACKAUDIO=$$AUDIO^ACKQUTL4
IF 'ACKAUDIO!($LENGTH(ACKLAMD)>7)
SET Y="@270"
+1 QUIT
51 SET DW="4;10"
SET DV="RNJ3,0"
SET DU=""
SET DLB="TONE L3000"
SET DIFLD=4.1
+1 GOTO RE
X51 if +X'=X!(X>105)!(X<-10)!(X?.E1"."1N.N)
KILL X
+1 QUIT
+2 ;
52 ;@210
SET DQ=53
53 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=53
DO X53
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X53 SET ACKAUDIO=$$AUDIO^ACKQUTL4
IF 'ACKAUDIO!($LENGTH(ACKLAMD)>7)
SET Y="@270"
+1 QUIT
54 SET DW="4;11"
SET DV="RNJ3,0"
SET DU=""
SET DLB="TONE L4000"
SET DIFLD=4.11
+1 GOTO RE
X54 if +X'=X!(X>105)!(X<-10)!(X?.E1"."1N.N)
KILL X
+1 QUIT
+2 ;
55 ;@230
SET DQ=56
56 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=56
DO X56
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X56 SET ACKAUDIO=$$AUDIO^ACKQUTL4
IF 'ACKAUDIO!($LENGTH(ACKLAMD)>7)
SET Y="@270"
+1 QUIT
57 SET DW="4;13"
SET DV="NJ3,0"
SET DU=""
SET DLB="CNC R"
SET DIFLD=4.13
+1 GOTO RE
X57 if +X'=X!(X>100)!(X<0)!(X?.E1"."1N.N)
KILL X
+1 QUIT
+2 ;
58 ;@240
SET DQ=59
59 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=59
DO X59
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X59 SET ACKAUDIO=$$AUDIO^ACKQUTL4
IF 'ACKAUDIO!($LENGTH(ACKLAMD)>7)
SET Y="@270"
+1 QUIT
60 SET DW="4;14"
SET DV="NJ3,0"
SET DU=""
SET DLB="CNC L"
SET DIFLD=4.14
+1 GOTO RE
X60 if +X'=X!(X>100)!(X<0)!(X?.E1"."1N.N)
KILL X
+1 QUIT
+2 ;
61 ;@250
SET DQ=62
62 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=62
DO X62
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X62 SET ACKAUDIO=$$AUDIO^ACKQUTL4
IF 'ACKAUDIO!($LENGTH(ACKLAMD)>7)
SET Y="@270"
+1 QUIT
63 SET DW="4;15"
SET DV="NJ3,0"
SET DU=""
SET DLB="W22 R"
SET DIFLD=4.15
+1 GOTO RE
X63 if +X'=X!(X>100)!(X<0)!(X?.E1"."1N.N)
KILL X
+1 QUIT
+2 ;
64 ;@260
SET DQ=65
65 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=65
DO X65
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X65 SET ACKAUDIO=$$AUDIO^ACKQUTL4
IF 'ACKAUDIO!($LENGTH(ACKLAMD)>7)
SET Y="@270"
+1 QUIT
66 SET DW="4;16"
SET DV="NJ3,0"
SET DU=""
SET DLB="W22 L"
SET DIFLD=4.16
+1 GOTO RE
X66 if +X'=X!(X>100)!(X<0)!(X?.E1"."1N.N)
KILL X
+1 QUIT
+2 ;
67 ;@265
SET DQ=68
68 SET DW="4;23"
SET DV="D"
SET DU=""
SET DLB="DATE OF AUDIOMETRIC TESTING"
SET DIFLD=4.23
+1 GOTO RE
X68 SET %DT="EX"
DO ^%DT
SET X=Y
if Y<1
KILL X
+1 QUIT
+2 ;
69 ;@270
SET DQ=70
70 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=70
DO X70
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X70 IF ACKCP'=1
SET Y="@320"
+1 QUIT
71 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=71
DO X71
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X71 SET ACKQHLP="^509850.6^100"
DO ^ACKQHLP
+1 QUIT
72 ;100
SET D=0
KILL DE(1)
+1 SET Y="REVIEW OF MEDICAL RECORDS^W^^0;1^Q"
SET DG="100"
SET DC="^509850.62"
DO DIEN^DIWE
KILL DE(1)
GOTO A
+2 ;
73 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=73
DO X73
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X73 IF $DATA(DIRUT)
SET Y="@999"
+1 QUIT
74 ;@280
SET DQ=75
75 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=75
DO X75
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X75 IF ACKCP'=1
SET Y="@320"
+1 QUIT
76 if $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=76
DO X76
if $DATA(DIEFIRE)#2
DO FIREREC^DIE17
if $DATA(Y)[0
GOTO A
if Y=U
GOTO A
SET X=Y
SET DIC(0)="F"
SET DW=DQ
GOTO OUT^DIE17
X76 SET ACKQHLP="^509850.6^101"
DO ^ACKQHLP
+1 QUIT
77 if $DATA(DG)>9
DO F^DIE17
GOTO ^ACKQTE7