AQAOT941 ; GENERATED FROM 'AQAO LONG DISPLAY-E1' PRINT TEMPLATE (#1273) ; 05/13/96 ; (continued)
G BEGIN
N W !
T W:$X ! I '$D(DIOT(2)),DN,$D(IOSL),$S('$D(DIWF):1,$P(DIWF,"B",2):$P(DIWF,"B",2),1:1)+$Y'<IOSL,$D(^UTILITY($J,1))#2,^(1)?1U1P1E.E X ^(1)
S DISTP=DISTP+1,DILCT=DILCT+1 D:'(DISTP#100) CSTP^DIO2
Q
DT I $G(DUZ("LANG"))>1,Y W $$OUT^DIALOGU(Y,"DD") Q
I Y W $P("JAN^FEB^MAR^APR^MAY^JUN^JUL^AUG^SEP^OCT^NOV^DEC",U,$E(Y,4,5))_" " W:Y#100 $J(Y#100\1,2)_"," W Y\10000+1700 W:Y#1 " "_$E(Y_0,9,10)_":"_$E(Y_"000",11,12) Q
W Y Q
M D @DIXX
Q
BEGIN ;
S:'$D(DN) DN=1 S DISTP=$G(DISTP),DILCT=$G(DILCT)
S Y=$P(X,U,4) S C=$P(^DD(9002167,.14,0),U,2) D Y^DIQ:Y S C="," W $E(Y,1,22)
D N:$X>50 Q:'DN W ?50 W "Rev Date: "
S Y=$P(X,U,8) D DT
D N:$X>0 Q:'DN W ?0 W "Adv Outcome Risk: "
S Y=$P(X,U,11) S Y(0)=Y S:Y]"" Y=$P(^AQAO1(3,Y,0),U)_" "_$P(^(0),U,2) W $E(Y,1,30)
D N:$X>47 Q:'DN W ?47 W "Occ Outcome: "
S X=$G(^AQAOC(D0,1)) S Y=$P(X,U,7) S Y(0)=Y S:Y]"" Y=$P(^AQAO1(3,Y,0),U)_" "_$P(^(0),U,4) W $E(Y,1,30)
D N:$X>9 Q:'DN W ?9 W "Finding: "
X DXS(16,9.2) S X=$P(DIP(101),U,2) S D0=I(0,0) K DIP K:DN Y W X
D N:$X>41 Q:'DN W ?41 X DXS(17,9.2) S DIP(3)=X S X=1,DIP(4)=X S X="",X=$S(DIP(2):DIP(3),DIP(4):X) K DIP K:DN Y W X
S X=$G(^AQAOC(D0,1)) S Y=$P(X,U,2) S Y=$S(Y="":Y,$D(^AQAO1(2,Y,0))#2:$P(^(0),U,1),1:Y) W $E(Y,1,50)
D N:$X>52 Q:'DN W ?52 W "Action: "
X DXS(18,9.2) S X=$P(DIP(101),U,2) S D0=I(0,0) K DIP K:DN Y W X
X DXS(19,9.5) S DIP(6)=X S X=",",X=$P(DIP(6),X) S Y=X,X=DIP(5),X=X_Y,X=$S(DIP(2):DIP(3),DIP(4):X) K DIP K:DN Y W $E(X,1,10)
S I(1)="""IADDRV""",J(1)=9002167.03 F D1=0:0 Q:$O(^AQAOC(D0,"IADDRV",D1))'>0 X:$D(DSC(9002167.03)) DSC(9002167.03) S D1=$O(^(D1)) Q:D1'>0 D:$X>52 T Q:'DN D H1
G H1R
H1 ;
D N:$X>66 Q:'DN W ?66 X DXS(20,9.3) S DIP(2)=X S X=",",X=$P(DIP(2),X) K DIP K:DN Y W $E(X,1,10)
Q
H1R ;
D N:$X>1 Q:'DN W ?1 W "Review Comments: "
S I(1)="""1RC""",J(1)=9002167.06 F D1=0:0 Q:$O(^AQAOC(D0,"1RC",D1))'>0 S D1=$O(^(D1)) D:$X>20 T Q:'DN D I1
G I1R
I1 ;
S X=$G(^AQAOC(D0,"1RC",D1,0)) S DIWL=20,DIWR=78 D ^DIWP
Q
I1R ;
D 0^DIWW K DIP K:DN Y
D ^DIWW
S I(1)="""REV""",J(1)=9002167.01 F D1=0:0 Q:$O(^AQAOC(D0,"REV",D1))'>0 X:$D(DSC(9002167.01)) DSC(9002167.01) S D1=$O(^(D1)) Q:D1'>0 D:$X>19 NX^DIWW D J1
G J1R
J1 ;
D T Q:'DN D N D N:$X>4 Q:'DN W ?4 W "Review Level: "
S X=$G(^AQAOC(D0,"REV",D1,0)) S Y=$P(X,U,1) S Y=$S(Y="":Y,$D(^AQAO(7,Y,0))#2:$P(^(0),U,1),1:Y) W $E(Y,1,4)
D N:$X>23 Q:'DN W ?23 W "by "
S Y=$P(X,U,2) S C=$P(^DD(9002167.01,.02,0),U,2) D Y^DIQ:Y S C="," W $E(Y,1,22)
D N:$X>50 Q:'DN W ?50 W "Rev Date: "
S Y=$P(X,U,4) D DT
D N:$X>0 Q:'DN W ?0 W "Adv Outcome Risk: "
S Y=$P(X,U,11) S Y(0)=Y S:Y]"" Y=$P(^AQAO1(3,Y,0),U)_" "_$P(^(0),U,2) W $E(Y,1,30)
D N:$X>47 Q:'DN W ?47 W "Occ Outcome: "
S X=$G(^AQAOC(D0,"REV",D1,0)) S Y=$P(X,U,6) S Y(0)=Y S:Y]"" Y=$P(^AQAO1(3,Y,0),U)_" "_$P(^(0),U,4) W $E(Y,1,30)
D N:$X>9 Q:'DN W ?9 W "Finding: "
X DXS(21,9.2) S DIP(101)=$S($D(^AQAO(8,D0,0)):^(0),1:"") S X=$P(DIP(101),U,2) S D0=I(0,0) S D1=I(1,0) K DIP K:DN Y W X
D N:$X>52 Q:'DN W ?52 W "Action: "
X DXS(22,9.2) S DIP(101)=$S($D(^AQAO(6,D0,0)):^(0),1:"") S X=$P(DIP(101),U,2) S D0=I(0,0) S D1=I(1,0) K DIP K:DN Y W X
X DXS(23,9.5) S DIP(6)=X S X=",",X=$P(DIP(6),X) S Y=X,X=DIP(5),X=X_Y,X=$S(DIP(2):DIP(3),DIP(4):X) K DIP K:DN Y W $E(X,1,10)
S I(2)="""ADDRV""",J(2)=9002167.12 F D2=0:0 Q:$O(^AQAOC(D0,"REV",D1,"ADDRV",D2))'>0 X:$D(DSC(9002167.12)) DSC(9002167.12) S D2=$O(^(D2)) Q:D2'>0 D:$X>52 T Q:'DN D A2
G A2R
A2 ;
D N:$X>66 Q:'DN W ?66 X DXS(24,9.3) S DIP(2)=X S X=",",X=$P(DIP(2),X) K DIP K:DN Y W $E(X,1,10)
Q
A2R ;
D N:$X>1 Q:'DN W ?1 W "Review Comments: "
S I(2)="""COMMENT""",J(2)=9002167.11 F D2=0:0 Q:$O(^AQAOC(D0,"REV",D1,"COMMENT",D2))'>0 S D2=$O(^(D2)) D:$X>20 T Q:'DN D B2
G B2R
B2 ;
S X=$G(^AQAOC(D0,"REV",D1,"COMMENT",D2,0)) S DIWL=20,DIWR=78 D ^DIWP
Q
B2R ;
D A^DIWW
Q
J1R ;
D T Q:'DN D N D N:$X>5 Q:'DN W ?5 W "Date Case Closed: "
S X=$G(^AQAOC(D0,"FINAL")) S Y=$P(X,U,1) D DT
D N:$X>44 Q:'DN W ?44 W "Final Review Level: "
S Y=$P(X,U,2) S Y=$S(Y="":Y,$D(^AQAO(7,Y,0))#2:$P(^(0),U,1),1:Y) W $E(Y,1,4)
D N:$X>0 Q:'DN W ?0 W "Final Risk Assessment: "
S Y=$P(X,U,3) S Y(0)=Y S:Y]"" Y=$P(^AQAO1(3,Y,0),U)_" "_$P(^(0),U,2) W $E(Y,1,30)
D N:$X>45 Q:'DN W ?45 W "Final Occ Outcome: "
G ^AQAOT942
AQAOT941 ; GENERATED FROM 'AQAO LONG DISPLAY-E1' PRINT TEMPLATE (#1273) ; 05/13/96 ; (continued)
+1 GOTO BEGIN
N WRITE !
T IF $X
WRITE !
IF '$DATA(DIOT(2))
IF DN
IF $DATA(IOSL)
IF $SELECT('$DATA(DIWF):1,$PIECE(DIWF,"B",2):$PIECE(DIWF,"B",2),1:1)+$Y'<IOSL
IF $DATA(^UTILITY($JOB,1))#2
IF ^(1)?1U1P1E.E
XECUTE ^(1)
+1 SET DISTP=DISTP+1
SET DILCT=DILCT+1
IF '(DISTP#100)
DO CSTP^DIO2
+2 QUIT
DT IF $GET(DUZ("LANG"))>1
IF Y
WRITE $$OUT^DIALOGU(Y,"DD")
QUIT
+1 IF Y
WRITE $PIECE("JAN^FEB^MAR^APR^MAY^JUN^JUL^AUG^SEP^OCT^NOV^DEC",U,$EXTRACT(Y,4,5))_" "
IF Y#100
WRITE $JUSTIFY(Y#100\1,2)_","
WRITE Y\10000+1700
IF Y#1
WRITE " "_$EXTRACT(Y_0,9,10)_":"_$EXTRACT(Y_"000",11,12)
QUIT
+2 WRITE Y
QUIT
M DO @DIXX
+1 QUIT
BEGIN ;
+1 IF '$DATA(DN)
SET DN=1
SET DISTP=$GET(DISTP)
SET DILCT=$GET(DILCT)
+2 SET Y=$PIECE(X,U,4)
SET C=$PIECE(^DD(9002167,.14,0),U,2)
IF Y
DO Y^DIQ
SET C=","
WRITE $EXTRACT(Y,1,22)
+3 IF $X>50
DO N
IF 'DN
QUIT
WRITE ?50
WRITE "Rev Date: "
+4 SET Y=$PIECE(X,U,8)
DO DT
+5 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "Adv Outcome Risk: "
+6 SET Y=$PIECE(X,U,11)
SET Y(0)=Y
IF Y]""
SET Y=$PIECE(^AQAO1(3,Y,0),U)_" "_$PIECE(^(0),U,2)
WRITE $EXTRACT(Y,1,30)
+7 IF $X>47
DO N
IF 'DN
QUIT
WRITE ?47
WRITE "Occ Outcome: "
+8 SET X=$GET(^AQAOC(D0,1))
SET Y=$PIECE(X,U,7)
SET Y(0)=Y
IF Y]""
SET Y=$PIECE(^AQAO1(3,Y,0),U)_" "_$PIECE(^(0),U,4)
WRITE $EXTRACT(Y,1,30)
+9 IF $X>9
DO N
IF 'DN
QUIT
WRITE ?9
WRITE "Finding: "
+10 XECUTE DXS(16,9.2)
SET X=$PIECE(DIP(101),U,2)
SET D0=I(0,0)
KILL DIP
IF DN
KILL Y
WRITE X
+11 IF $X>41
DO N
IF 'DN
QUIT
WRITE ?41
XECUTE DXS(17,9.2)
SET DIP(3)=X
SET X=1
SET DIP(4)=X
SET X=""
SET X=$SELECT(DIP(2):DIP(3),DIP(4):X)
KILL DIP
IF DN
KILL Y
WRITE X
+12 SET X=$GET(^AQAOC(D0,1))
SET Y=$PIECE(X,U,2)
SET Y=$SELECT(Y="":Y,$DATA(^AQAO1(2,Y,0))#2:$PIECE(^(0),U,1),1:Y)
WRITE $EXTRACT(Y,1,50)
+13 IF $X>52
DO N
IF 'DN
QUIT
WRITE ?52
WRITE "Action: "
+14 XECUTE DXS(18,9.2)
SET X=$PIECE(DIP(101),U,2)
SET D0=I(0,0)
KILL DIP
IF DN
KILL Y
WRITE X
+15 XECUTE DXS(19,9.5)
SET DIP(6)=X
SET X=","
SET X=$PIECE(DIP(6),X)
SET Y=X
SET X=DIP(5)
SET X=X_Y
SET X=$SELECT(DIP(2):DIP(3),DIP(4):X)
KILL DIP
IF DN
KILL Y
WRITE $EXTRACT(X,1,10)
+16 SET I(1)="""IADDRV"""
SET J(1)=9002167.03
FOR D1=0:0
IF $ORDER(^AQAOC(D0,"IADDRV",D1))'>0
QUIT
IF $DATA(DSC(9002167.03))
XECUTE DSC(9002167.03)
SET D1=$ORDER(^(D1))
IF D1'>0
QUIT
IF $X>52
DO T
IF 'DN
QUIT
DO H1
+17 GOTO H1R
H1 ;
+1 IF $X>66
DO N
IF 'DN
QUIT
WRITE ?66
XECUTE DXS(20,9.3)
SET DIP(2)=X
SET X=","
SET X=$PIECE(DIP(2),X)
KILL DIP
IF DN
KILL Y
WRITE $EXTRACT(X,1,10)
+2 QUIT
H1R ;
+1 IF $X>1
DO N
IF 'DN
QUIT
WRITE ?1
WRITE "Review Comments: "
+2 SET I(1)="""1RC"""
SET J(1)=9002167.06
FOR D1=0:0
IF $ORDER(^AQAOC(D0,"1RC",D1))'>0
QUIT
SET D1=$ORDER(^(D1))
IF $X>20
DO T
IF 'DN
QUIT
DO I1
+3 GOTO I1R
I1 ;
+1 SET X=$GET(^AQAOC(D0,"1RC",D1,0))
SET DIWL=20
SET DIWR=78
DO ^DIWP
+2 QUIT
I1R ;
+1 DO 0^DIWW
KILL DIP
IF DN
KILL Y
+2 DO ^DIWW
+3 SET I(1)="""REV"""
SET J(1)=9002167.01
FOR D1=0:0
IF $ORDER(^AQAOC(D0,"REV",D1))'>0
QUIT
IF $DATA(DSC(9002167.01))
XECUTE DSC(9002167.01)
SET D1=$ORDER(^(D1))
IF D1'>0
QUIT
IF $X>19
DO NX^DIWW
DO J1
+4 GOTO J1R
J1 ;
+1 DO T
IF 'DN
QUIT
DO N
IF $X>4
DO N
IF 'DN
QUIT
WRITE ?4
WRITE "Review Level: "
+2 SET X=$GET(^AQAOC(D0,"REV",D1,0))
SET Y=$PIECE(X,U,1)
SET Y=$SELECT(Y="":Y,$DATA(^AQAO(7,Y,0))#2:$PIECE(^(0),U,1),1:Y)
WRITE $EXTRACT(Y,1,4)
+3 IF $X>23
DO N
IF 'DN
QUIT
WRITE ?23
WRITE "by "
+4 SET Y=$PIECE(X,U,2)
SET C=$PIECE(^DD(9002167.01,.02,0),U,2)
IF Y
DO Y^DIQ
SET C=","
WRITE $EXTRACT(Y,1,22)
+5 IF $X>50
DO N
IF 'DN
QUIT
WRITE ?50
WRITE "Rev Date: "
+6 SET Y=$PIECE(X,U,4)
DO DT
+7 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "Adv Outcome Risk: "
+8 SET Y=$PIECE(X,U,11)
SET Y(0)=Y
IF Y]""
SET Y=$PIECE(^AQAO1(3,Y,0),U)_" "_$PIECE(^(0),U,2)
WRITE $EXTRACT(Y,1,30)
+9 IF $X>47
DO N
IF 'DN
QUIT
WRITE ?47
WRITE "Occ Outcome: "
+10 SET X=$GET(^AQAOC(D0,"REV",D1,0))
SET Y=$PIECE(X,U,6)
SET Y(0)=Y
IF Y]""
SET Y=$PIECE(^AQAO1(3,Y,0),U)_" "_$PIECE(^(0),U,4)
WRITE $EXTRACT(Y,1,30)
+11 IF $X>9
DO N
IF 'DN
QUIT
WRITE ?9
WRITE "Finding: "
+12 XECUTE DXS(21,9.2)
SET DIP(101)=$SELECT($DATA(^AQAO(8,D0,0)):^(0),1:"")
SET X=$PIECE(DIP(101),U,2)
SET D0=I(0,0)
SET D1=I(1,0)
KILL DIP
IF DN
KILL Y
WRITE X
+13 IF $X>52
DO N
IF 'DN
QUIT
WRITE ?52
WRITE "Action: "
+14 XECUTE DXS(22,9.2)
SET DIP(101)=$SELECT($DATA(^AQAO(6,D0,0)):^(0),1:"")
SET X=$PIECE(DIP(101),U,2)
SET D0=I(0,0)
SET D1=I(1,0)
KILL DIP
IF DN
KILL Y
WRITE X
+15 XECUTE DXS(23,9.5)
SET DIP(6)=X
SET X=","
SET X=$PIECE(DIP(6),X)
SET Y=X
SET X=DIP(5)
SET X=X_Y
SET X=$SELECT(DIP(2):DIP(3),DIP(4):X)
KILL DIP
IF DN
KILL Y
WRITE $EXTRACT(X,1,10)
+16 SET I(2)="""ADDRV"""
SET J(2)=9002167.12
FOR D2=0:0
IF $ORDER(^AQAOC(D0,"REV",D1,"ADDRV",D2))'>0
QUIT
IF $DATA(DSC(9002167.12))
XECUTE DSC(9002167.12)
SET D2=$ORDER(^(D2))
IF D2'>0
QUIT
IF $X>52
DO T
IF 'DN
QUIT
DO A2
+17 GOTO A2R
A2 ;
+1 IF $X>66
DO N
IF 'DN
QUIT
WRITE ?66
XECUTE DXS(24,9.3)
SET DIP(2)=X
SET X=","
SET X=$PIECE(DIP(2),X)
KILL DIP
IF DN
KILL Y
WRITE $EXTRACT(X,1,10)
+2 QUIT
A2R ;
+1 IF $X>1
DO N
IF 'DN
QUIT
WRITE ?1
WRITE "Review Comments: "
+2 SET I(2)="""COMMENT"""
SET J(2)=9002167.11
FOR D2=0:0
IF $ORDER(^AQAOC(D0,"REV",D1,"COMMENT",D2))'>0
QUIT
SET D2=$ORDER(^(D2))
IF $X>20
DO T
IF 'DN
QUIT
DO B2
+3 GOTO B2R
B2 ;
+1 SET X=$GET(^AQAOC(D0,"REV",D1,"COMMENT",D2,0))
SET DIWL=20
SET DIWR=78
DO ^DIWP
+2 QUIT
B2R ;
+1 DO A^DIWW
+2 QUIT
J1R ;
+1 DO T
IF 'DN
QUIT
DO N
IF $X>5
DO N
IF 'DN
QUIT
WRITE ?5
WRITE "Date Case Closed: "
+2 SET X=$GET(^AQAOC(D0,"FINAL"))
SET Y=$PIECE(X,U,1)
DO DT
+3 IF $X>44
DO N
IF 'DN
QUIT
WRITE ?44
WRITE "Final Review Level: "
+4 SET Y=$PIECE(X,U,2)
SET Y=$SELECT(Y="":Y,$DATA(^AQAO(7,Y,0))#2:$PIECE(^(0),U,1),1:Y)
WRITE $EXTRACT(Y,1,4)
+5 IF $X>0
DO N
IF 'DN
QUIT
WRITE ?0
WRITE "Final Risk Assessment: "
+6 SET Y=$PIECE(X,U,3)
SET Y(0)=Y
IF Y]""
SET Y=$PIECE(^AQAO1(3,Y,0),U)_" "_$PIECE(^(0),U,2)
WRITE $EXTRACT(Y,1,30)
+7 IF $X>45
DO N
IF 'DN
QUIT
WRITE ?45
WRITE "Final Occ Outcome: "
+8 GOTO ^AQAOT942