QAOSPCM0 ;HISC/DAD-COMMITTEE REVIEWER WORKSHEET ;2/16/93 09:19
;;3.0;Occurrence Screen;;09/14/1993
S QAOSSCRN=+$G(^QA(741,QAOSD0,"SCRN")),QAOSCOMM=$O(^QA(741.2,"C",4,0)),QAOSREVR=4,QAOSQUIT=0
I QAOSDATA=1 S QAOSD1="" D LOOP1 W:$E(IOST)'="C" @IOF D G EXIT
. Q:$E(IOST)'="C" Q:QAOSQUIT
. K DIR S DIR(0)="E" D ^DIR K DIR
. S QAOSQUIT=$S(Y'>0:1,1:0)
. Q
I QAOSDATA=2,'$D(^QA(741,QAOSD0,"CMTE","B")) S QAOSD1="" D LOOP1 W:$E(IOST)'="C" @IOF D G EXIT
. Q:$E(IOST)'="C" Q:QAOSQUIT
. K DIR S DIR(0)="E" D ^DIR K DIR
. S QAOSQUIT=$S(Y'>0:1,1:0)
. Q
F QAOSCOMM=0:0 S QAOSCOMM=$O(^QA(741,QAOSD0,"CMTE","B",QAOSCOMM)) Q:QAOSCOMM'>0!QAOSQUIT D LOOP0
EXIT ;
K ARRAY,CODE,CODES,D0,DIWF,DIWL,DIWR,LOC,QA,QAOSD1,QAOSHEAD,QAOSMULT,QAOSPAGE,QAOSREVR,QAOSSCRN,QAOSCOMM,X,XX,Y
Q
LOOP0 ;
F QAOSD1=0:0 S QAOSD1=$O(^QA(741,QAOSD0,"CMTE","B",QAOSCOMM,QAOSD1)) Q:QAOSD1'>0!QAOSQUIT D LOOP1 W:$E(IOST)'="C" @IOF I ('QAOSQUIT),$E(IOST)="C" K DIR S DIR(0)="E" D ^DIR K DIR S QAOSQUIT=$S(Y'>0:1,1:0) Q:QAOSQUIT
Q
LOOP1 ;
S QAOSMULT=$S(QAOSD1'>0:"",$D(^QA(741,QAOSD0,"CMTE",QAOSD1,0))#2:^(0),1:"")
S QA=$P(QAOSMULT,"^") S $P(QAOSREVR,"^",2)=$S(QA'>0:"",$D(^QA(741.97,QA,0))#2:$P(^(0),"^"),1:"")
S QAOSPAGE=1 D ^QAOSPHDR
S QAOSHEAD="CONFIRMED ISSUE" W !!,QAOSHEAD S LOC=$P(QAOSMULT,"^",5),CODES=$P(^DD(741.017,4,0),"^",3)
F QA=1:1:$L(CODES,";")-1 S CODE=$P(CODES,";",QA) W !?3,$S(LOC=+CODE:"_X_",1:"___"),?8,$J(+CODE,3,0),?15,$P(CODE,":",2) D CHK Q:QAOSQUIT
G:QAOSQUIT EXIT
S QAOSHEAD="COMMENTS" W !!,QAOSHEAD S DIWL=4,DIWR=75,DIWF="" K ^UTILITY($J,"W")
I QAOSHOW'=3,QAOSDATA=2 F QAOSS0=0:0 S QAOSS0=$O(^QA(741,QAOSD0,"CMTE",+QAOSD1,1,QAOSS0)) Q:QAOSS0'>0 S X=^QA(741,QAOSD0,"CMTE",QAOSD1,1,QAOSS0,0) D ^DIWP
F QA=0:0 S QA=$O(^UTILITY($J,"W",DIWL,QA)) Q:QA'>0!QAOSQUIT W !?3,^UTILITY($J,"W",DIWL,QA,0) D CHK
Q:QAOSQUIT
BLANK I $Y<(IOSL-6) W ! G BLANK
W !,"SIGNATURE"
Q
CHK ;
Q:$Y'>(IOSL-6) N D0,QA,Y I $E(IOST)="C" K DIR S DIR(0)="E" D ^DIR K DIR S QAOSQUIT=$S(Y'>0:1,1:0) Q:QAOSQUIT
D ^QAOSPHDR W !!,QAOSHEAD
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HQAOSPCM0 2060 printed Nov 22, 2024@17:31:40 Page 2
QAOSPCM0 ;HISC/DAD-COMMITTEE REVIEWER WORKSHEET ;2/16/93 09:19
+1 ;;3.0;Occurrence Screen;;09/14/1993
+2 SET QAOSSCRN=+$GET(^QA(741,QAOSD0,"SCRN"))
SET QAOSCOMM=$ORDER(^QA(741.2,"C",4,0))
SET QAOSREVR=4
SET QAOSQUIT=0
+3 IF QAOSDATA=1
SET QAOSD1=""
DO LOOP1
if $EXTRACT(IOST)'="C"
WRITE @IOF
Begin DoDot:1
+4 if $EXTRACT(IOST)'="C"
QUIT
if QAOSQUIT
QUIT
+5 KILL DIR
SET DIR(0)="E"
DO ^DIR
KILL DIR
+6 SET QAOSQUIT=$SELECT(Y'>0:1,1:0)
+7 QUIT
End DoDot:1
GOTO EXIT
+8 IF QAOSDATA=2
IF '$DATA(^QA(741,QAOSD0,"CMTE","B"))
SET QAOSD1=""
DO LOOP1
if $EXTRACT(IOST)'="C"
WRITE @IOF
Begin DoDot:1
+9 if $EXTRACT(IOST)'="C"
QUIT
if QAOSQUIT
QUIT
+10 KILL DIR
SET DIR(0)="E"
DO ^DIR
KILL DIR
+11 SET QAOSQUIT=$SELECT(Y'>0:1,1:0)
+12 QUIT
End DoDot:1
GOTO EXIT
+13 FOR QAOSCOMM=0:0
SET QAOSCOMM=$ORDER(^QA(741,QAOSD0,"CMTE","B",QAOSCOMM))
if QAOSCOMM'>0!QAOSQUIT
QUIT
DO LOOP0
EXIT ;
+1 KILL ARRAY,CODE,CODES,D0,DIWF,DIWL,DIWR,LOC,QA,QAOSD1,QAOSHEAD,QAOSMULT,QAOSPAGE,QAOSREVR,QAOSSCRN,QAOSCOMM,X,XX,Y
+2 QUIT
LOOP0 ;
+1 FOR QAOSD1=0:0
SET QAOSD1=$ORDER(^QA(741,QAOSD0,"CMTE","B",QAOSCOMM,QAOSD1))
if QAOSD1'>0!QAOSQUIT
QUIT
DO LOOP1
if $EXTRACT(IOST)'="C"
WRITE @IOF
IF ('QAOSQUIT)
IF $EXTRACT(IOST)="C"
KILL DIR
SET DIR(0)="E"
DO ^DIR
KILL DIR
SET QAOSQUIT=$SELECT(Y'>0:1,1:0)
if QAOSQUIT
QUIT
+2 QUIT
LOOP1 ;
+1 SET QAOSMULT=$SELECT(QAOSD1'>0:"",$DATA(^QA(741,QAOSD0,"CMTE",QAOSD1,0))#2:^(0),1:"")
+2 SET QA=$PIECE(QAOSMULT,"^")
SET $PIECE(QAOSREVR,"^",2)=$SELECT(QA'>0:"",$DATA(^QA(741.97,QA,0))#2:$PIECE(^(0),"^"),1:"")
+3 SET QAOSPAGE=1
DO ^QAOSPHDR
+4 SET QAOSHEAD="CONFIRMED ISSUE"
WRITE !!,QAOSHEAD
SET LOC=$PIECE(QAOSMULT,"^",5)
SET CODES=$PIECE(^DD(741.017,4,0),"^",3)
+5 FOR QA=1:1:$LENGTH(CODES,";")-1
SET CODE=$PIECE(CODES,";",QA)
WRITE !?3,$SELECT(LOC=+CODE:"_X_",1:"___"),?8,$JUSTIFY(+CODE,3,0),?15,$PIECE(CODE,":",2)
DO CHK
if QAOSQUIT
QUIT
+6 if QAOSQUIT
GOTO EXIT
+7 SET QAOSHEAD="COMMENTS"
WRITE !!,QAOSHEAD
SET DIWL=4
SET DIWR=75
SET DIWF=""
KILL ^UTILITY($JOB,"W")
+8 IF QAOSHOW'=3
IF QAOSDATA=2
FOR QAOSS0=0:0
SET QAOSS0=$ORDER(^QA(741,QAOSD0,"CMTE",+QAOSD1,1,QAOSS0))
if QAOSS0'>0
QUIT
SET X=^QA(741,QAOSD0,"CMTE",QAOSD1,1,QAOSS0,0)
DO ^DIWP
+9 FOR QA=0:0
SET QA=$ORDER(^UTILITY($JOB,"W",DIWL,QA))
if QA'>0!QAOSQUIT
QUIT
WRITE !?3,^UTILITY($JOB,"W",DIWL,QA,0)
DO CHK
+10 if QAOSQUIT
QUIT
BLANK IF $Y<(IOSL-6)
WRITE !
GOTO BLANK
+1 WRITE !,"SIGNATURE"
+2 QUIT
CHK ;
+1 if $Y'>(IOSL-6)
QUIT
NEW D0,QA,Y
IF $EXTRACT(IOST)="C"
KILL DIR
SET DIR(0)="E"
DO ^DIR
KILL DIR
SET QAOSQUIT=$SELECT(Y'>0:1,1:0)
if QAOSQUIT
QUIT
+2 DO ^QAOSPHDR
WRITE !!,QAOSHEAD
+3 QUIT