GMTSXQ02 ; SLC/JER - XQOR1 for Export w/Health Summary ;1/10/92 14:55
;;2.5;Health Summary;;Dec 16, 1992
XQOR1 ; SLC/KCM - Main Unwinding Loop ;3/13/90 11:34 ;
;;6.52;Copyright 1990, DVA;
LOOP ;From: EN^XQOR
I "QOL"[$P(^UTILITY("XQORS",$J,XQORS,"FLG"),"^"),'$D(^UTILITY("XQORS",$J,0,"CTXT","ADD")) D ENTRY^XQORO G:$D(XQORQUIT)!$D(XQORPOP)!$D(DIROUT)!$D(DTOUT) EXCT
D EACH G:$D(XQORQUIT)!$D(XQORPOP)!$D(DIROUT)!$D(DTOUT) EXCT
I $D(@(^UTILITY("XQORS",$J,XQORS,"REF")_"20)"))'[0 S Y=^(20) I $L(Y) K X X Y S:$D(X)'[0 ^UTILITY("XQORS",$J,XQORS,"X")=X
I $D(XQORQUIT)!$D(XQORPOP)!$D(DIROUT)!$D(DTOUT) G EXAT
I $D(XQORFLG) S:$D(XQORFLG("PS")) $P(^UTILITY("XQORS",$J,XQORS,"FLG"),"^",2)=+XQORFLG("PS") S:$D(XQORFLG("SH")) $P(^UTILITY("XQORS",$J,XQORS,"FLG"),"^",5)=+XQORFLG("SH") K XQORFLG
REDO D @$S("QM"[$P(^UTILITY("XQORS",$J,XQORS,"FLG"),"^"):"MENU^XQOR3","OX"[$P(^UTILITY("XQORS",$J,XQORS,"FLG"),"^"):"ACT^XQOR2",1:"NUL^XQOR2")
G:'^UTILITY("XQORS",$J,XQORS,"ITM") EXAT S ^UTILITY("XQORS",$J,XQORS,"TOT")=^UTILITY("XQORS",$J,XQORS,"ITM"),^UTILITY("XQORS",$J,XQORS,"ITM")=0
STAK S ^UTILITY("XQORS",$J,XQORS,"ITM")=^UTILITY("XQORS",$J,XQORS,"ITM")+1 G:^UTILITY("XQORS",$J,XQORS,"ITM")>^UTILITY("XQORS",$J,XQORS,"TOT") EXST
I '^UTILITY("XQORS",$J,XQORS,"ITM",^UTILITY("XQORS",$J,XQORS,"ITM")) S $P(^UTILITY("XQORS",$J,XQORS,"FLG"),"^",4)=1 D DJMP^XQOR4 K XQORPOP,XQORQUIT G NXT
I $D(^UTILITY("XQORS",$J,XQORS,"ITM",^UTILITY("XQORS",$J,XQORS,"ITM"),"MA")) S X=^UTILITY("XQORS",$J,XQORS,"ITM",^UTILITY("XQORS",$J,XQORS,"ITM"),"MA") D EN^XQOR G:$D(XQORQUIT)!$D(XQORPOP)!$D(DIROUT)!$D(DTOUT) NXT
S X=^UTILITY("XQORS",$J,XQORS,"ITM",^UTILITY("XQORS",$J,XQORS,"ITM")) D EN^XQOR
NXT K XQORQUIT I '$D(XQORPOP),'$D(DIROUT),'$D(DTOUT) G STAK
EXST S ^UTILITY("XQORS",$J,0,"FILE")=";"_$P(^UTILITY("XQORS",$J,XQORS,"VPT"),";",2) S:$D(^UTILITY("XQORS",$J,XQORS,"INP")) $P(^UTILITY("XQORS",$J,XQORS,"INP"),"^",4)="" K XQORPOP
I $P(^UTILITY("XQORS",$J,XQORS,"FLG"),"^",2)!$P(^UTILITY("XQORS",$J,XQORS,"FLG"),"^",4) S $P(^UTILITY("XQORS",$J,XQORS,"FLG"),"^",4)=""
I I '$D(DIROUT),'$D(DTOUT) D EACH I '$D(XQORQUIT),'$D(XQORPOP),'$D(DIROUT),'$D(DTOUT) K ^UTILITY("XQORS",$J,XQORS,"ITM") G REDO
EXAT I $P(^UTILITY("XQORS",$J,XQORS,"FLG"),"^",6) G EX^XQOR
I $D(@(^UTILITY("XQORS",$J,XQORS,"REF")_"15)"))'[0 S X=^(15) I $L(X) X X
EXCT I $D(^UTILITY("XQORS",$J,XQORS,"CTX","AD")) D EXIT^XQORO
G EX^XQOR
EACH I $P(^UTILITY("XQORS",$J,XQORS,"FLG"),"^",3),"AXLO"[$P(^UTILITY("XQORS",$J,XQORS,"FLG"),"^") D SHDR^XQOR4
S XQORNOD=^UTILITY("XQORS",$J,XQORS,"VPT"),XQORNOD(0)=^UTILITY("XQORS",$J,XQORS,"INP")
D:$D(OROLD) RSTR^XQORO ;OE/RR Context
I "QOL"[$P(^UTILITY("XQORS",$J,XQORS,"FLG"),"^"),$D(^UTILITY("XQORS",$J,0,"CTXT","ADD")) D EVERY^XQORO
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HGMTSXQ02 2764 printed Dec 13, 2024@02:01:05 Page 2
GMTSXQ02 ; SLC/JER - XQOR1 for Export w/Health Summary ;1/10/92 14:55
+1 ;;2.5;Health Summary;;Dec 16, 1992
XQOR1 ; SLC/KCM - Main Unwinding Loop ;3/13/90 11:34 ;
+1 ;;6.52;Copyright 1990, DVA;
LOOP ;From: EN^XQOR
+1 IF "QOL"[$PIECE(^UTILITY("XQORS",$JOB,XQORS,"FLG"),"^")
IF '$DATA(^UTILITY("XQORS",$JOB,0,"CTXT","ADD"))
DO ENTRY^XQORO
if $DATA(XQORQUIT)!$DATA(XQORPOP)!$DATA(DIROUT)!$DATA(DTOUT)
GOTO EXCT
+2 DO EACH
if $DATA(XQORQUIT)!$DATA(XQORPOP)!$DATA(DIROUT)!$DATA(DTOUT)
GOTO EXCT
+3 IF $DATA(@(^UTILITY("XQORS",$JOB,XQORS,"REF")_"20)"))'[0
SET Y=^(20)
IF $LENGTH(Y)
KILL X
XECUTE Y
if $DATA(X)'[0
SET ^UTILITY("XQORS",$JOB,XQORS,"X")=X
+4 IF $DATA(XQORQUIT)!$DATA(XQORPOP)!$DATA(DIROUT)!$DATA(DTOUT)
GOTO EXAT
+5 IF $DATA(XQORFLG)
if $DATA(XQORFLG("PS"))
SET $PIECE(^UTILITY("XQORS",$JOB,XQORS,"FLG"),"^",2)=+XQORFLG("PS")
if $DATA(XQORFLG("SH"))
SET $PIECE(^UTILITY("XQORS",$JOB,XQORS,"FLG"),"^",5)=+XQORFLG("SH")
KILL XQORFLG
REDO DO @$SELECT("QM"[$PIECE(^UTILITY("XQORS",$JOB,XQORS,"FLG"),"^"):"MENU^XQOR3","OX"[$PIECE(^UTILITY("XQORS",$JOB,XQORS,"FLG"),"^"):"ACT^XQOR2",1:"NUL^XQOR2")
+1 if '^UTILITY("XQORS",$JOB,XQORS,"ITM")
GOTO EXAT
SET ^UTILITY("XQORS",$JOB,XQORS,"TOT")=^UTILITY("XQORS",$JOB,XQORS,"ITM")
SET ^UTILITY("XQORS",$JOB,XQORS,"ITM")=0
STAK SET ^UTILITY("XQORS",$JOB,XQORS,"ITM")=^UTILITY("XQORS",$JOB,XQORS,"ITM")+1
if ^UTILITY("XQORS",$JOB,XQORS,"ITM")>^UTILITY("XQORS",$JOB,XQORS,"TOT")
GOTO EXST
+1 IF '^UTILITY("XQORS",$JOB,XQORS,"ITM",^UTILITY("XQORS",$JOB,XQORS,"ITM"))
SET $PIECE(^UTILITY("XQORS",$JOB,XQORS,"FLG"),"^",4)=1
DO DJMP^XQOR4
KILL XQORPOP,XQORQUIT
GOTO NXT
+2 IF $DATA(^UTILITY("XQORS",$JOB,XQORS,"ITM",^UTILITY("XQORS",$JOB,XQORS,"ITM"),"MA"))
SET X=^UTILITY("XQORS",$JOB,XQORS,"ITM",^UTILITY("XQORS",$JOB,XQORS,"ITM"),"MA")
DO EN^XQOR
if $DATA(XQORQUIT)!$DATA(XQORPOP)!$DATA(DIROUT)!$DATA(DTOUT)
GOTO NXT
+3 SET X=^UTILITY("XQORS",$JOB,XQORS,"ITM",^UTILITY("XQORS",$JOB,XQORS,"ITM"))
DO EN^XQOR
NXT KILL XQORQUIT
IF '$DATA(XQORPOP)
IF '$DATA(DIROUT)
IF '$DATA(DTOUT)
GOTO STAK
EXST SET ^UTILITY("XQORS",$JOB,0,"FILE")=";"_$PIECE(^UTILITY("XQORS",$JOB,XQORS,"VPT"),";",2)
if $DATA(^UTILITY("XQORS",$JOB,XQORS,"INP"))
SET $PIECE(^UTILITY("XQORS",$JOB,XQORS,"INP"),"^",4)=""
KILL XQORPOP
+1 IF $PIECE(^UTILITY("XQORS",$JOB,XQORS,"FLG"),"^",2)!$PIECE(^UTILITY("XQORS",$JOB,XQORS,"FLG"),"^",4)
SET $PIECE(^UTILITY("XQORS",$JOB,XQORS,"FLG"),"^",4)=""
+2 IF $TEST
IF '$DATA(DIROUT)
IF '$DATA(DTOUT)
DO EACH
IF '$DATA(XQORQUIT)
IF '$DATA(XQORPOP)
IF '$DATA(DIROUT)
IF '$DATA(DTOUT)
KILL ^UTILITY("XQORS",$JOB,XQORS,"ITM")
GOTO REDO
EXAT IF $PIECE(^UTILITY("XQORS",$JOB,XQORS,"FLG"),"^",6)
GOTO EX^XQOR
+1 IF $DATA(@(^UTILITY("XQORS",$JOB,XQORS,"REF")_"15)"))'[0
SET X=^(15)
IF $LENGTH(X)
XECUTE X
EXCT IF $DATA(^UTILITY("XQORS",$JOB,XQORS,"CTX","AD"))
DO EXIT^XQORO
+1 GOTO EX^XQOR
EACH IF $PIECE(^UTILITY("XQORS",$JOB,XQORS,"FLG"),"^",3)
IF "AXLO"[$PIECE(^UTILITY("XQORS",$JOB,XQORS,"FLG"),"^")
DO SHDR^XQOR4
+1 SET XQORNOD=^UTILITY("XQORS",$JOB,XQORS,"VPT")
SET XQORNOD(0)=^UTILITY("XQORS",$JOB,XQORS,"INP")
+2 ;OE/RR Context
if $DATA(OROLD)
DO RSTR^XQORO
+3 IF "QOL"[$PIECE(^UTILITY("XQORS",$JOB,XQORS,"FLG"),"^")
IF $DATA(^UTILITY("XQORS",$JOB,0,"CTXT","ADD"))
DO EVERY^XQORO
+4 QUIT