RACTWR ; GENERATED FROM 'RA REPORT EDIT' INPUT TEMPLATE(#1439), FILE 74;01/20/12
D DE G BEGIN
DE S DIE="^RARPT(",DIC=DIE,DP=74,DL=1,DIEL=0,DU="" K DG,DE,DB Q:$O(^RARPT(DA,""))=""
I $D(^(0)) S %Z=^(0) S %=$P(%Z,U,5) S:%]"" DE(33)=%,DE(42)=%,DE(44)=% S %=$P(%Z,U,6) S:%]"" DE(3)=% S %=$P(%Z,U,8) S:%]"" DE(8)=% S %=$P(%Z,U,9) S:%]"" DE(47)=%
I $D(^("P")) S %Z=^("P") S %=$E(%Z,1,240) S:%'?." " DE(34)=%
I $D(^("T")) S %Z=^("T") S %=$P(%Z,U,1) S:%]"" DE(4)=%
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="RACTWR",DQ=1
N DIEZTMP,DIEZAR,DIEZRXR,DIIENS,DIXR K DIEFIRE,DIEBADK S DIEZTMP=$$GETTMP^DIKC1("DIEZ")
M DIEZAR=^DIE(1439,"AR") S DICRREC="TRIG^DIE17"
S:$D(DTIME)[0 DTIME=300 S D0=DA,DIIENS=DA_",",DIEZ=1439,U="^"
1 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=1 D X1 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
X1 I '$D(RACT) W !?3,$C(7),"Variable RACT must be defined to continue!" S Y="@99"
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:RACT'="I" Y="@10"
Q
3 S DW="0;6",DV="D",DU="",DLB="DATE REPORT ENTERED",DIFLD=6
S X="NOW"
S Y=X
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)
G RD
X3 S %DT="STX" D ^%DT S X=Y K:Y<1 X
Q
;
4 S DW="T;1",DV="*P200'",DU="",DLB="TRANSCRIPTIONIST",DIFLD=11
S DE(DW)="C4^RACTWR"
S DU="VA(200,"
S X=DUZ
S Y=X
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)
G RD:X="@",Z
C4 G C4S:$D(DE(4))[0 K DB
S X=DE(4),DIC=DIE
K:$P($G(^RARPT(DA,0)),U,6)]"" ^RARPT("AD",$E(X,1,30),$P(^RARPT(DA,0),U,6),DA)
C4S S X="" G:DG(DQ)=X C4F1 K DB
S X=DG(DQ),DIC=DIE
S:$P($G(^RARPT(DA,0)),U,6)]"" ^RARPT("AD",$E(X,1,30),$P(^RARPT(DA,0),U,6),DA)=""
C4F1 Q
X4 Q
5 S DQ=6 ;@10
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 RATRSC=$P(^RARPT(DA,"T"),U)
Q
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
X7 I $D(RARPDT) I (RADTE\1)>(($E(RARPDT,7,10)-1700)_$E(RARPDT,1,2)_$E(RARPDT,4,5)) K RARPDT
Q
8 D:$D(DG)>9 F^DIE17,DE S DQ=8,DW="0;8",DV="DX",DU="",DLB="REPORTED DATE",DIFLD=8
S X=$S($D(RARPDT):RARPDT,1:"")
S Y=X
G Y
X8 S %DT="EX",%DT(0)=$P($G(^RARPT(D0,0)),U,3)\1 D ^%DT K %DT(0) S X=Y K:Y<1 X
Q
;
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
X9 S:X?7N RARPDT=$E(X,4,5)_"/"_$E(X,6,7)_"/"_(1700+$E(X,1,3))
Q
10 S DQ=11 ;@15
11 S D=0 K DE(1) ;100
S DIFLD=100,DGO="^RACTWR1",DC="10^74.01DA^L^",DV="74.01RD",DW="0;1",DOW="LOG DATE",DLB=$P($$EZBLD^DIALOG(8042,DOW),":") S:D DC=DC_D
I $D(DSC(74.01))#2,$P(DSC(74.01),"I $D(^UTILITY(",1)="" X DSC(74.01) S D=$O(^(0)) S:D="" D=-1 G M11
S D=$S($D(^RARPT(DA,"L",0)):$P(^(0),U,3,4),$O(^(0))'="":$O(^(0)),1:-1)
M11 I D>0 S DC=DC_D I $D(^RARPT(DA,"L",+D,0)) S DE(11)=$P(^(0),U,1)
S X="""NOW"""
S Y=X
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)
G RD
R11 D DE
G A
;
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 S:RACT="V" Y="@99"
Q
13 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=13 D X13 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
X13 W !,"------------------------------------------------------------------------------"
Q
14 S DQ=15 ;@1
15 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=15 D X15 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
X15 D CHPRINT^RAUTL9
Q
16 S D=0 K DE(1) ;400
S Y="ADDITIONAL CLINICAL HISTORY^W^^0;1^Q",DG="H",DC="^74.04" D DIEN^DIWE K DE(1) G A
;
17 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=17 D X17 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
X17 S RANODE="H"
Q
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 I $O(^RARPT(DA,RANODE,0)) D UPDT^RAUTL3("^RARPT("_DA_","""_RANODE_""",")
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 W !,"------------------------------------------------------------------------------"
Q
20 S DQ=21 ;@2
21 S D=0 K DE(1) ;200
S Y="REPORT TEXT^W^^0;1^Q",DG="R",DC="^74.02" D DIEN^DIWE K DE(1) G A
;
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 S RANODE="R" D EXIST^RAUTL9
Q
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
X23 I $O(^RARPT(DA,RANODE,0)) D UPDT^RAUTL3("^RARPT("_DA_","""_RANODE_""",")
Q
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 W !,"------------------------------------------------------------------------------"
Q
25 S DQ=26 ;@3
26 S D=0 K DE(1) ;300
S Y="IMPRESSION TEXT^W^^0;1^Q",DG="I",DC="^74.03" D DIEN^DIWE K DE(1) G A
;
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
X27 S RANODE="I" D EXIST^RAUTL9
Q
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
X28 I $O(^RARPT(DA,RANODE,0)) D UPDT^RAUTL3("^RARPT("_DA_","""_RANODE_""",")
Q
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 W !,"------------------------------------------------------------------------------"
Q
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
X30 I $O(^RARPT(DA,"I",0))>0 S Y=$S($D(RAONLINE):"@99",1:"@30")
Q
31 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=31 D X31 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
X31 I $D(^RADPT(+$P(^RARPT(DA,0),U,2),"DT",(9999999.9999-$P(^RARPT(DA,0),U,3)),0)),$D(^RA(79,+$P(^(0),U,3),.1)),$P(^(.1),U,16)'["Y" S Y=$S($D(RAONLINE):"@99",1:"@30")
Q
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 I '$O(^RARPT(DA,"R",0)) S Y="@99"
Q
33 S DW="0;5",DV="RSX",DU="",DLB="REPORT STATUS",DIFLD=5
S DE(DW)="C33^RACTWR"
S DU="V:VERIFIED;R:RELEASED/NOT VERIFIED;PD:PROBLEM DRAFT;D:DRAFT;EF:ELECTRONICALLY FILED;X:DELETED;"
S Y="PROBLEM DRAFT"
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)
G RD
C33 G C33S:$D(DE(33))[0 K DB
S X=DE(33),DIC=DIE
X "D ^RABUL2 Q"
S X=DE(33),DIC=DIE
N RAXREF K RASET S RAXREF="ARES",RARAD=12,RAKILL="" D XREF^RAUTL2 S RASECOND="SRR" D SECXREF^RADD1 K RAKILL,RARAD
S X=DE(33),DIC=DIE
N RAXREF K RASET S RAXREF="ASTF",RARAD=15,RAKILL="" D XREF^RAUTL2 S RASECOND="SSR" D SECXREF^RADD1 K RAKILL,RARAD
S X=DE(33),DIC=DIE
K ^RARPT("ASTAT",$E(X,1,30),DA)
C33S S X="" G:DG(DQ)=X C33F1 K DB
S X=DG(DQ),DIC=DIE
;
S X=DG(DQ),DIC=DIE
N RAXREF K RAKILL I X'="V"&(X'="X") S RAXREF="ARES",RARAD=12,RASET="" D XREF^RAUTL2 S RASECOND="SRR" D SECXREF^RADD1 K RARAD,RASET
S X=DG(DQ),DIC=DIE
N RAXREF K RAKILL I X'="V"&(X'="X") S RAXREF="ASTF",RARAD=15,RASET="" D XREF^RAUTL2 S RASECOND="SSR" D SECXREF^RADD1 K RARAD,RASEC
S X=DG(DQ),DIC=DIE
S:"Vv"'[$E(X) ^RARPT("ASTAT",$E(X,1,30),DA)=""
C33F1 Q
X33 D EN1^RAUTL4
Q
;
34 D:$D(DG)>9 F^DIE17,DE S DQ=34,DW="P;E1,240",DV="F",DU="",DLB="PROBLEM STATEMENT",DIFLD=25
S Y="No Impression was entered for this report."
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)
G RD
X34 K:$L(X)>240!($L(X)<2) X
I $D(X),X'?.ANP K X
Q
;
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 W !!?3,$C(7),"NOTE: This report does not have an impression. As a result,",!?3," the report will be placed in a 'PROBLEM DRAFT' status",!?3," with an appropriate 'PROBLEM STATEMENT' entered as well.",!
Q
36 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=36 D X36 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
X36 S Y="@99"
Q
37 S DQ=38 ;@30
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 D EN1^RAUTL9
Q
39 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=39 D X39 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
X39 S:'$D(DIRUT) Y="@40"
Q
40 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=40 D X40 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
X40 D:$D(DIE("NO^"))&($G(DIE("NO^"))'="OUTOK")&($G(DIE("NO^"))'="BACKOUTOK") EN^DDIOL("EXIT NOT ALLOWED ??"_$C(7),"","!!?3")
Q
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:$D(DIE("NO^"))&($G(DIE("NO^"))'="OUTOK")&($G(DIE("NO^"))'="BACKOUTOK") Y="@30"
Q
42 S DW="0;5",DV="RSX",DU="",DLB="REPORT STATUS",DIFLD=5
S DE(DW)="C42^RACTWR"
S DU="V:VERIFIED;R:RELEASED/NOT VERIFIED;PD:PROBLEM DRAFT;D:DRAFT;EF:ELECTRONICALLY FILED;X:DELETED;"
S X="^"
S Y=X
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)
G RD
C42 G C42S:$D(DE(42))[0 K DB
S X=DE(42),DIC=DIE
X "D ^RABUL2 Q"
S X=DE(42),DIC=DIE
N RAXREF K RASET S RAXREF="ARES",RARAD=12,RAKILL="" D XREF^RAUTL2 S RASECOND="SRR" D SECXREF^RADD1 K RAKILL,RARAD
S X=DE(42),DIC=DIE
N RAXREF K RASET S RAXREF="ASTF",RARAD=15,RAKILL="" D XREF^RAUTL2 S RASECOND="SSR" D SECXREF^RADD1 K RAKILL,RARAD
S X=DE(42),DIC=DIE
K ^RARPT("ASTAT",$E(X,1,30),DA)
C42S S X="" G:DG(DQ)=X C42F1 K DB
S X=DG(DQ),DIC=DIE
;
S X=DG(DQ),DIC=DIE
N RAXREF K RAKILL I X'="V"&(X'="X") S RAXREF="ARES",RARAD=12,RASET="" D XREF^RAUTL2 S RASECOND="SRR" D SECXREF^RADD1 K RARAD,RASET
S X=DG(DQ),DIC=DIE
N RAXREF K RAKILL I X'="V"&(X'="X") S RAXREF="ASTF",RARAD=15,RASET="" D XREF^RAUTL2 S RASECOND="SSR" D SECXREF^RADD1 K RARAD,RASEC
S X=DG(DQ),DIC=DIE
S:"Vv"'[$E(X) ^RARPT("ASTAT",$E(X,1,30),DA)=""
C42F1 Q
X42 D EN1^RAUTL4
Q
;
43 S DQ=44 ;@40
44 D:$D(DG)>9 F^DIE17,DE S DQ=44,DW="0;5",DV="RSX",DU="",DLB="REPORT STATUS",DIFLD=5
S DE(DW)="C44^RACTWR"
S DU="V:VERIFIED;R:RELEASED/NOT VERIFIED;PD:PROBLEM DRAFT;D:DRAFT;EF:ELECTRONICALLY FILED;X:DELETED;"
S X=RASTATX
S Y=X
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)
G RD
C44 G C44S:$D(DE(44))[0 K DB
S X=DE(44),DIC=DIE
X "D ^RABUL2 Q"
S X=DE(44),DIC=DIE
N RAXREF K RASET S RAXREF="ARES",RARAD=12,RAKILL="" D XREF^RAUTL2 S RASECOND="SRR" D SECXREF^RADD1 K RAKILL,RARAD
S X=DE(44),DIC=DIE
N RAXREF K RASET S RAXREF="ASTF",RARAD=15,RAKILL="" D XREF^RAUTL2 S RASECOND="SSR" D SECXREF^RADD1 K RAKILL,RARAD
S X=DE(44),DIC=DIE
K ^RARPT("ASTAT",$E(X,1,30),DA)
C44S S X="" G:DG(DQ)=X C44F1 K DB
S X=DG(DQ),DIC=DIE
;
S X=DG(DQ),DIC=DIE
N RAXREF K RAKILL I X'="V"&(X'="X") S RAXREF="ARES",RARAD=12,RASET="" D XREF^RAUTL2 S RASECOND="SRR" D SECXREF^RADD1 K RARAD,RASET
S X=DG(DQ),DIC=DIE
N RAXREF K RAKILL I X'="V"&(X'="X") S RAXREF="ASTF",RARAD=15,RASET="" D XREF^RAUTL2 S RASECOND="SSR" D SECXREF^RADD1 K RARAD,RASEC
S X=DG(DQ),DIC=DIE
S:"Vv"'[$E(X) ^RARPT("ASTAT",$E(X,1,30),DA)=""
C44F1 Q
X44 D EN1^RAUTL4
Q
;
45 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=45 D X45 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
X45 S:RASTATX="V" RACT=RASTATX S:RASTATX'="V" Y=$S($E(RASTATX)="P":"@50",1:"@99") I $E(RASTATX)'="P" K ^RARPT(DA,"P")
Q
46 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=46 D X46 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
X46 I X="V",'$D(^XUSEC("RA VERIFY",DUZ)) W !!,$C(7),"You do not have the appropriate privileges to verify a report." S Y="@35"
Q
47 D:$D(DG)>9 F^DIE17,DE S DQ=47,DW="0;9",DV="*P200'X",DU="",DLB="VERIFYING PHYSICIAN",DIFLD=9
S DU="VA(200,"
S X=$S($D(RAELESIG):"`"_DUZ,1:"")
S Y=X
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)
G RD
X47 S DIC("S")="N RAINADT X ^DD(74,9,9.2) I $S('RAINADT:1,DT'>RAINADT:1,1:0),$D(^XUSEC(""RA VERIFY"",+Y)),($D(^VA(200,""ARC"",""R"",+Y))!($D(^VA(200,""ARC"",""S"",+Y))))" D ^DIC K DIC S DIC=DIE,X=+Y K:Y<0 X
Q
;
48 D:$D(DG)>9 F^DIE17,DE S Y=U,DQ=48 D X48 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
X48 S:$D(RAELESIG) Y="@33"
Q
49 D:$D(DG)>9 F^DIE17 G ^RACTWR2
RACTWR ; GENERATED FROM 'RA REPORT EDIT' INPUT TEMPLATE(#1439), FILE 74;01/20/12
+1 DO DE
GOTO BEGIN
DE SET DIE="^RARPT("
SET DIC=DIE
SET DP=74
SET DL=1
SET DIEL=0
SET DU=""
KILL DG,DE,DB
IF $ORDER(^RARPT(DA,""))=""
QUIT
+1 IF $DATA(^(0))
SET %Z=^(0)
SET %=$PIECE(%Z,U,5)
IF %]""
SET DE(33)=%
SET DE(42)=%
SET DE(44)=%
SET %=$PIECE(%Z,U,6)
IF %]""
SET DE(3)=%
SET %=$PIECE(%Z,U,8)
IF %]""
SET DE(8)=%
SET %=$PIECE(%Z,U,9)
IF %]""
SET DE(47)=%
+2 IF $DATA(^("P"))
SET %Z=^("P")
SET %=$EXTRACT(%Z,1,240)
IF %'?." "
SET DE(34)=%
+3 IF $DATA(^("T"))
SET %Z=^("T")
SET %=$PIECE(%Z,U,1)
IF %]""
SET DE(4)=%
+4 KILL %Z
QUIT
+5 ;
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="RACTWR"
SET DQ=1
+1 NEW DIEZTMP,DIEZAR,DIEZRXR,DIIENS,DIXR
KILL DIEFIRE,DIEBADK
SET DIEZTMP=$$GETTMP^DIKC1("DIEZ")
+2 MERGE DIEZAR=^DIE(1439,"AR")
SET DICRREC="TRIG^DIE17"
+3 IF $DATA(DTIME)[0
SET DTIME=300
SET D0=DA
SET DIIENS=DA_","
SET DIEZ=1439
SET U="^"
1 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=1
DO X1
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
X1 IF '$DATA(RACT)
WRITE !?3,$CHAR(7),"Variable RACT must be defined to continue!"
SET Y="@99"
+1 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 IF RACT'="I"
SET Y="@10"
+1 QUIT
3 SET DW="0;6"
SET DV="D"
SET DU=""
SET DLB="DATE REPORT ENTERED"
SET DIFLD=6
+1 SET X="NOW"
+2 SET Y=X
+3 SET X=Y
SET DB(DQ)=1
IF X=""
IF DV
GOTO N^DIE17
GOTO A
IF $DATA(DE(DQ))
IF DV["I"!(DV["#")
DO E^DIE0
IF '$DATA(X)
GOTO A
+4 GOTO RD
X3 SET %DT="STX"
DO ^%DT
SET X=Y
IF Y<1
KILL X
+1 QUIT
+2 ;
4 SET DW="T;1"
SET DV="*P200'"
SET DU=""
SET DLB="TRANSCRIPTIONIST"
SET DIFLD=11
+1 SET DE(DW)="C4^RACTWR"
+2 SET DU="VA(200,"
+3 SET X=DUZ
+4 SET Y=X
+5 SET X=Y
SET DB(DQ)=1
SET DE(DW,"4/")=""
IF X=""
IF DV
GOTO N^DIE17
GOTO A
IF $DATA(DE(DQ))
IF DV["I"!(DV["#")
DO E^DIE0
IF '$DATA(X)
GOTO A
+6 IF X="@"
GOTO RD
GOTO Z
C4 IF $DATA(DE(4))[0
GOTO C4S
KILL DB
+1 SET X=DE(4)
SET DIC=DIE
+2 IF $PIECE($GET(^RARPT(DA,0)),U,6)]""
KILL ^RARPT("AD",$EXTRACT(X,1,30),$PIECE(^RARPT(DA,0),U,6),DA)
C4S SET X=""
IF DG(DQ)=X
GOTO C4F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 IF $PIECE($GET(^RARPT(DA,0)),U,6)]""
SET ^RARPT("AD",$EXTRACT(X,1,30),$PIECE(^RARPT(DA,0),U,6),DA)=""
C4F1 QUIT
X4 QUIT
5 ;@10
SET DQ=6
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 RATRSC=$PIECE(^RARPT(DA,"T"),U)
+1 QUIT
7 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=7
DO X7
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
X7 IF $DATA(RARPDT)
IF (RADTE\1)>(($EXTRACT(RARPDT,7,10)-1700)_$EXTRACT(RARPDT,1,2)_$EXTRACT(RARPDT,4,5))
KILL RARPDT
+1 QUIT
8 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=8
SET DW="0;8"
SET DV="DX"
SET DU=""
SET DLB="REPORTED DATE"
SET DIFLD=8
+1 SET X=$SELECT($DATA(RARPDT):RARPDT,1:"")
+2 SET Y=X
+3 GOTO Y
X8 SET %DT="EX"
SET %DT(0)=$PIECE($GET(^RARPT(D0,0)),U,3)\1
DO ^%DT
KILL %DT(0)
SET X=Y
IF Y<1
KILL X
+1 QUIT
+2 ;
9 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=9
DO X9
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
X9 IF X?7N
SET RARPDT=$EXTRACT(X,4,5)_"/"_$EXTRACT(X,6,7)_"/"_(1700+$EXTRACT(X,1,3))
+1 QUIT
10 ;@15
SET DQ=11
11 ;100
SET D=0
KILL DE(1)
+1 SET DIFLD=100
SET DGO="^RACTWR1"
SET DC="10^74.01DA^L^"
SET DV="74.01RD"
SET DW="0;1"
SET DOW="LOG DATE"
SET DLB=$PIECE($$EZBLD^DIALOG(8042,DOW),":")
IF D
SET DC=DC_D
+2 IF $DATA(DSC(74.01))#2
IF $PIECE(DSC(74.01),"I $D(^UTILITY(",1)=""
XECUTE DSC(74.01)
SET D=$ORDER(^(0))
IF D=""
SET D=-1
GOTO M11
+3 SET D=$SELECT($DATA(^RARPT(DA,"L",0)):$PIECE(^(0),U,3,4),$ORDER(^(0))'="":$ORDER(^(0)),1:-1)
M11 IF D>0
SET DC=DC_D
IF $DATA(^RARPT(DA,"L",+D,0))
SET DE(11)=$PIECE(^(0),U,1)
+1 SET X="""NOW"""
+2 SET Y=X
+3 SET X=Y
SET DB(DQ)=1
IF X=""
IF DV
GOTO N^DIE17
GOTO A
IF $DATA(DE(DQ))
IF DV["I"!(DV["#")
DO E^DIE0
IF '$DATA(X)
GOTO A
+4 GOTO RD
R11 DO DE
+1 GOTO A
+2 ;
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 RACT="V"
SET Y="@99"
+1 QUIT
13 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=13
DO X13
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
X13 WRITE !,"------------------------------------------------------------------------------"
+1 QUIT
14 ;@1
SET DQ=15
15 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=15
DO X15
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
X15 DO CHPRINT^RAUTL9
+1 QUIT
16 ;400
SET D=0
KILL DE(1)
+1 SET Y="ADDITIONAL CLINICAL HISTORY^W^^0;1^Q"
SET DG="H"
SET DC="^74.04"
DO DIEN^DIWE
KILL DE(1)
GOTO A
+2 ;
17 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=17
DO X17
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
X17 SET RANODE="H"
+1 QUIT
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 IF $ORDER(^RARPT(DA,RANODE,0))
DO UPDT^RAUTL3("^RARPT("_DA_","""_RANODE_""",")
+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 WRITE !,"------------------------------------------------------------------------------"
+1 QUIT
20 ;@2
SET DQ=21
21 ;200
SET D=0
KILL DE(1)
+1 SET Y="REPORT TEXT^W^^0;1^Q"
SET DG="R"
SET DC="^74.02"
DO DIEN^DIWE
KILL DE(1)
GOTO A
+2 ;
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 SET RANODE="R"
DO EXIST^RAUTL9
+1 QUIT
23 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=23
DO X23
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
X23 IF $ORDER(^RARPT(DA,RANODE,0))
DO UPDT^RAUTL3("^RARPT("_DA_","""_RANODE_""",")
+1 QUIT
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 WRITE !,"------------------------------------------------------------------------------"
+1 QUIT
25 ;@3
SET DQ=26
26 ;300
SET D=0
KILL DE(1)
+1 SET Y="IMPRESSION TEXT^W^^0;1^Q"
SET DG="I"
SET DC="^74.03"
DO DIEN^DIWE
KILL DE(1)
GOTO A
+2 ;
27 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=27
DO X27
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
X27 SET RANODE="I"
DO EXIST^RAUTL9
+1 QUIT
28 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=28
DO X28
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
X28 IF $ORDER(^RARPT(DA,RANODE,0))
DO UPDT^RAUTL3("^RARPT("_DA_","""_RANODE_""",")
+1 QUIT
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 WRITE !,"------------------------------------------------------------------------------"
+1 QUIT
30 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=30
DO X30
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
X30 IF $ORDER(^RARPT(DA,"I",0))>0
SET Y=$SELECT($DATA(RAONLINE):"@99",1:"@30")
+1 QUIT
31 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=31
DO X31
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
X31 IF $DATA(^RADPT(+$PIECE(^RARPT(DA,0),U,2),"DT",(9999999.9999-$PIECE(^RARPT(DA,0),U,3)),0))
IF $DATA(^RA(79,+$PIECE(^(0),U,3),.1))
IF $PIECE(^(.1),U,16)'["Y"
SET Y=$SELECT($DATA(RAONLINE):"@99",1:"@30")
+1 QUIT
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 IF '$ORDER(^RARPT(DA,"R",0))
SET Y="@99"
+1 QUIT
33 SET DW="0;5"
SET DV="RSX"
SET DU=""
SET DLB="REPORT STATUS"
SET DIFLD=5
+1 SET DE(DW)="C33^RACTWR"
+2 SET DU="V:VERIFIED;R:RELEASED/NOT VERIFIED;PD:PROBLEM DRAFT;D:DRAFT;EF:ELECTRONICALLY FILED;X:DELETED;"
+3 SET Y="PROBLEM DRAFT"
+4 SET X=Y
SET DB(DQ)=1
IF X=""
IF DV
GOTO N^DIE17
GOTO A
IF $DATA(DE(DQ))
IF DV["I"!(DV["#")
DO E^DIE0
IF '$DATA(X)
GOTO A
+5 GOTO RD
C33 IF $DATA(DE(33))[0
GOTO C33S
KILL DB
+1 SET X=DE(33)
SET DIC=DIE
+2 XECUTE "D ^RABUL2 Q"
+3 SET X=DE(33)
SET DIC=DIE
+4 NEW RAXREF
KILL RASET
SET RAXREF="ARES"
SET RARAD=12
SET RAKILL=""
DO XREF^RAUTL2
SET RASECOND="SRR"
DO SECXREF^RADD1
KILL RAKILL,RARAD
+5 SET X=DE(33)
SET DIC=DIE
+6 NEW RAXREF
KILL RASET
SET RAXREF="ASTF"
SET RARAD=15
SET RAKILL=""
DO XREF^RAUTL2
SET RASECOND="SSR"
DO SECXREF^RADD1
KILL RAKILL,RARAD
+7 SET X=DE(33)
SET DIC=DIE
+8 KILL ^RARPT("ASTAT",$EXTRACT(X,1,30),DA)
C33S SET X=""
IF DG(DQ)=X
GOTO C33F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 ;
+3 SET X=DG(DQ)
SET DIC=DIE
+4 NEW RAXREF
KILL RAKILL
IF X'="V"&(X'="X")
SET RAXREF="ARES"
SET RARAD=12
SET RASET=""
DO XREF^RAUTL2
SET RASECOND="SRR"
DO SECXREF^RADD1
KILL RARAD,RASET
+5 SET X=DG(DQ)
SET DIC=DIE
+6 NEW RAXREF
KILL RAKILL
IF X'="V"&(X'="X")
SET RAXREF="ASTF"
SET RARAD=15
SET RASET=""
DO XREF^RAUTL2
SET RASECOND="SSR"
DO SECXREF^RADD1
KILL RARAD,RASEC
+7 SET X=DG(DQ)
SET DIC=DIE
+8 IF "Vv"'[$EXTRACT(X)
SET ^RARPT("ASTAT",$EXTRACT(X,1,30),DA)=""
C33F1 QUIT
X33 DO EN1^RAUTL4
+1 QUIT
+2 ;
34 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=34
SET DW="P;E1,240"
SET DV="F"
SET DU=""
SET DLB="PROBLEM STATEMENT"
SET DIFLD=25
+1 SET Y="No Impression was entered for this report."
+2 SET X=Y
SET DB(DQ)=1
IF X=""
IF DV
GOTO N^DIE17
GOTO A
IF $DATA(DE(DQ))
IF DV["I"!(DV["#")
DO E^DIE0
IF '$DATA(X)
GOTO A
+3 GOTO RD
X34 IF $LENGTH(X)>240!($LENGTH(X)<2)
KILL X
+1 IF $DATA(X)
IF X'?.ANP
KILL X
+2 QUIT
+3 ;
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 WRITE !!?3,$CHAR(7),"NOTE: This report does not have an impression. As a result,",!?3," the report will be placed in a 'PROBLEM DRAFT' status",!?3," with an appropriate 'PROBLEM STATEMENT' entered as well.",!
+1 QUIT
36 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=36
DO X36
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
X36 SET Y="@99"
+1 QUIT
37 ;@30
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 DO EN1^RAUTL9
+1 QUIT
39 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=39
DO X39
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
X39 IF '$DATA(DIRUT)
SET Y="@40"
+1 QUIT
40 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=40
DO X40
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
X40 IF $DATA(DIE("NO^"))&($GET(DIE("NO^"))'="OUTOK")&($GET(DIE("NO^"))'="BACKOUTOK")
DO EN^DDIOL("EXIT NOT ALLOWED ??"_$CHAR(7),"","!!?3")
+1 QUIT
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 IF $DATA(DIE("NO^"))&($GET(DIE("NO^"))'="OUTOK")&($GET(DIE("NO^"))'="BACKOUTOK")
SET Y="@30"
+1 QUIT
42 SET DW="0;5"
SET DV="RSX"
SET DU=""
SET DLB="REPORT STATUS"
SET DIFLD=5
+1 SET DE(DW)="C42^RACTWR"
+2 SET DU="V:VERIFIED;R:RELEASED/NOT VERIFIED;PD:PROBLEM DRAFT;D:DRAFT;EF:ELECTRONICALLY FILED;X:DELETED;"
+3 SET X="^"
+4 SET Y=X
+5 SET X=Y
SET DB(DQ)=1
IF X=""
IF DV
GOTO N^DIE17
GOTO A
IF $DATA(DE(DQ))
IF DV["I"!(DV["#")
DO E^DIE0
IF '$DATA(X)
GOTO A
+6 GOTO RD
C42 IF $DATA(DE(42))[0
GOTO C42S
KILL DB
+1 SET X=DE(42)
SET DIC=DIE
+2 XECUTE "D ^RABUL2 Q"
+3 SET X=DE(42)
SET DIC=DIE
+4 NEW RAXREF
KILL RASET
SET RAXREF="ARES"
SET RARAD=12
SET RAKILL=""
DO XREF^RAUTL2
SET RASECOND="SRR"
DO SECXREF^RADD1
KILL RAKILL,RARAD
+5 SET X=DE(42)
SET DIC=DIE
+6 NEW RAXREF
KILL RASET
SET RAXREF="ASTF"
SET RARAD=15
SET RAKILL=""
DO XREF^RAUTL2
SET RASECOND="SSR"
DO SECXREF^RADD1
KILL RAKILL,RARAD
+7 SET X=DE(42)
SET DIC=DIE
+8 KILL ^RARPT("ASTAT",$EXTRACT(X,1,30),DA)
C42S SET X=""
IF DG(DQ)=X
GOTO C42F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 ;
+3 SET X=DG(DQ)
SET DIC=DIE
+4 NEW RAXREF
KILL RAKILL
IF X'="V"&(X'="X")
SET RAXREF="ARES"
SET RARAD=12
SET RASET=""
DO XREF^RAUTL2
SET RASECOND="SRR"
DO SECXREF^RADD1
KILL RARAD,RASET
+5 SET X=DG(DQ)
SET DIC=DIE
+6 NEW RAXREF
KILL RAKILL
IF X'="V"&(X'="X")
SET RAXREF="ASTF"
SET RARAD=15
SET RASET=""
DO XREF^RAUTL2
SET RASECOND="SSR"
DO SECXREF^RADD1
KILL RARAD,RASEC
+7 SET X=DG(DQ)
SET DIC=DIE
+8 IF "Vv"'[$EXTRACT(X)
SET ^RARPT("ASTAT",$EXTRACT(X,1,30),DA)=""
C42F1 QUIT
X42 DO EN1^RAUTL4
+1 QUIT
+2 ;
43 ;@40
SET DQ=44
44 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=44
SET DW="0;5"
SET DV="RSX"
SET DU=""
SET DLB="REPORT STATUS"
SET DIFLD=5
+1 SET DE(DW)="C44^RACTWR"
+2 SET DU="V:VERIFIED;R:RELEASED/NOT VERIFIED;PD:PROBLEM DRAFT;D:DRAFT;EF:ELECTRONICALLY FILED;X:DELETED;"
+3 SET X=RASTATX
+4 SET Y=X
+5 SET X=Y
SET DB(DQ)=1
IF X=""
IF DV
GOTO N^DIE17
GOTO A
IF $DATA(DE(DQ))
IF DV["I"!(DV["#")
DO E^DIE0
IF '$DATA(X)
GOTO A
+6 GOTO RD
C44 IF $DATA(DE(44))[0
GOTO C44S
KILL DB
+1 SET X=DE(44)
SET DIC=DIE
+2 XECUTE "D ^RABUL2 Q"
+3 SET X=DE(44)
SET DIC=DIE
+4 NEW RAXREF
KILL RASET
SET RAXREF="ARES"
SET RARAD=12
SET RAKILL=""
DO XREF^RAUTL2
SET RASECOND="SRR"
DO SECXREF^RADD1
KILL RAKILL,RARAD
+5 SET X=DE(44)
SET DIC=DIE
+6 NEW RAXREF
KILL RASET
SET RAXREF="ASTF"
SET RARAD=15
SET RAKILL=""
DO XREF^RAUTL2
SET RASECOND="SSR"
DO SECXREF^RADD1
KILL RAKILL,RARAD
+7 SET X=DE(44)
SET DIC=DIE
+8 KILL ^RARPT("ASTAT",$EXTRACT(X,1,30),DA)
C44S SET X=""
IF DG(DQ)=X
GOTO C44F1
KILL DB
+1 SET X=DG(DQ)
SET DIC=DIE
+2 ;
+3 SET X=DG(DQ)
SET DIC=DIE
+4 NEW RAXREF
KILL RAKILL
IF X'="V"&(X'="X")
SET RAXREF="ARES"
SET RARAD=12
SET RASET=""
DO XREF^RAUTL2
SET RASECOND="SRR"
DO SECXREF^RADD1
KILL RARAD,RASET
+5 SET X=DG(DQ)
SET DIC=DIE
+6 NEW RAXREF
KILL RAKILL
IF X'="V"&(X'="X")
SET RAXREF="ASTF"
SET RARAD=15
SET RASET=""
DO XREF^RAUTL2
SET RASECOND="SSR"
DO SECXREF^RADD1
KILL RARAD,RASEC
+7 SET X=DG(DQ)
SET DIC=DIE
+8 IF "Vv"'[$EXTRACT(X)
SET ^RARPT("ASTAT",$EXTRACT(X,1,30),DA)=""
C44F1 QUIT
X44 DO EN1^RAUTL4
+1 QUIT
+2 ;
45 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=45
DO X45
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
X45 IF RASTATX="V"
SET RACT=RASTATX
IF RASTATX'="V"
SET Y=$SELECT($EXTRACT(RASTATX)="P":"@50",1:"@99")
IF $EXTRACT(RASTATX)'="P"
KILL ^RARPT(DA,"P")
+1 QUIT
46 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=46
DO X46
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
X46 IF X="V"
IF '$DATA(^XUSEC("RA VERIFY",DUZ))
WRITE !!,$CHAR(7),"You do not have the appropriate privileges to verify a report."
SET Y="@35"
+1 QUIT
47 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET DQ=47
SET DW="0;9"
SET DV="*P200'X"
SET DU=""
SET DLB="VERIFYING PHYSICIAN"
SET DIFLD=9
+1 SET DU="VA(200,"
+2 SET X=$SELECT($DATA(RAELESIG):"`"_DUZ,1:"")
+3 SET Y=X
+4 SET X=Y
SET DB(DQ)=1
IF X=""
IF DV
GOTO N^DIE17
GOTO A
IF $DATA(DE(DQ))
IF DV["I"!(DV["#")
DO E^DIE0
IF '$DATA(X)
GOTO A
+5 GOTO RD
X47 SET D">D">D">DIC("S")="N RAINAD">D">D">DT X ^D">D">D">DD">D">D">D(74,9,9.2) I $S('RAINAD">D">D">DT:1,D">D">D">DT'>RAINAD">D">D">DT:1,1:0),$D">D">D">D(^XUSEC(""RA VERIFY"",+Y)),($D">D">D">D(^VA(200,""ARC"",""R"",+Y))!($D">D">D">D(^VA(200,""ARC"",""S"",+Y))))"
DO ^DIC
KILL DIC
SET DIC=DIE
SET X=+Y
IF Y<0
KILL X
+1 QUIT
+2 ;
48 IF $DATA(DG)>9
DO F^DIE17
DO DE
SET Y=U
SET DQ=48
DO X48
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
X48 IF $DATA(RAELESIG)
SET Y="@33"
+1 QUIT
49 IF $DATA(DG)>9
DO F^DIE17
GOTO ^RACTWR2