AQAOPC1 ; IHS/ORDC/LJF - OCC BY INDICATOR W/ CRITERIA ;
;;1.01;QAI MANAGEMENT;;OCT 05, 1995
;
;This rtn contains the user interface for the trending report by
;review criteria.
;
D CRIT^AQAOHOP2 ;intro text
TYPE ; >>> ask user what type of report to print
K DIR S DIR(0)="SO^L:LISTING PLUS STATISTICS;S:STATISTICS ONLY"
S DIR("A")="Choose TYPE of report to print"
S DIR("?",1)="Which report style do you want?"
S DIR("?",2)=" Enter L to list occurrences PLUS statistics"
S DIR("?",3)=" Enter S to print the statistical page ONLY"
S DIR("?")="For more information on these styles, see the User Manual."
D ^DIR G END:$D(DIRUT) S AQAOTYP=Y
;
IND ; >>> occurrences for which indicator?
S AQAOIND=$$IND^AQAOLKP G END:AQAOIND=U,TYPE:AQAOIND=-1
S AQAOIND=+AQAOIND
;
CRIT ; >>> check criteria defined for this indicator
I '$D(^AQAO1(6,"C",AQAOIND)) D G TYPE
.W !!,*7,"NO Criteria for this Indicator",!
S (X,AQAOCNT)=0 K AQAOCR,AQAOIOMX ;init count; kill array & iom var
F S X=$O(^AQAO1(6,"C",AQAOIND,X)) Q:X="" D
.Q:'$D(^AQAO1(6,X,0)) S AQAOCR(X)=$P(^(0),U) ;set array w/crit name
.S AQAOCNT=AQAOCNT+1 ;increment count
I (AQAOTYP="L"),(AQAOCNT>7) D
.S AQAOIOMX=132
.W !,*7,"You have more than 7 criteria for this indicator."
.W !,"Please use CONDENSED PRINT or WIDE PAPER.",!
;
; >> if too many defined, must choose up to 14 for this report
W !!,"There are ",AQAOCNT," criteria defined for this indicator. Only"
W !,"14 can fit on the report. Please choose up to 14 from the list."
W !! K DIR S DIR(0)="L^1:"_AQAOCNT_"^K:X#1 X",(Y,X)=0
F S X=$O(AQAOCR(X)) Q:X="" D
.S Y=Y+1,DIR("A",Y)=Y_". "_AQAOCR(X),AQAOAR(X)=Y
S DIR("A")="Choose the CRITERIA for this report" D ^DIR
G END:$D(DIRUT) I $P(Y,",",15)'="" G CRIT ;still too many
; >> kill off items not selected
F I=1:1 S X=$P(Y,",",I) Q:X="" S Y(X)=""
S X=0 F S X=$O(AQAOCR(X)) Q:X="" I '$D(Y(AQAOAR(X))) K AQAOCR(X)
K Y,AQAOAR
;
DATES ; >> ask user to choose date range
S AQAOBD=$$BDATE^AQAOLKP G IND:AQAOBD=U,IND:AQAOBD=""
S AQAOED=$$EDATE^AQAOLKP G DATES:AQAOED=U,DATES:AQAOED=""
;
;
DEV ; >>> get print device
I $P(AQAOUA("USER"),U,7)=1 D EXPORT^AQAOUTIL G DATES:Y=U
W !!
I $D(AQAOIOMX) W *7,"REMEMBER to use CONDENSED PRINT or WIDE PAPER!",!!
S %ZIS="QP" D ^%ZIS G END:POP
I '$D(IO("Q")) U IO G ^AQAOPC11
K IO("Q") S ZTRTN="^AQAOPC11",ZTDESC="OCC BY IND & CRIT"
F I="AQAOTYP","AQAOIND","AQAOCR(","AQAOBD","AQAOED" S ZTSAVE(I)=""
S:$D(AQAODLM) ZTSAVE("AQAODLM")=""
S:$D(AQAOIOMX) ZTSAVE("AQAOIOMX")=""
S:$D(AQAOXSN) ZTSAVE("AQAOXSN")="",ZTSAVE("AQAOXSM")=""
S:$D(AQAOXS) ZTSAVE("AQAOXS(")=""
D ^%ZTLOAD K ZTSK D ^%ZISC
;
END ; >>> eoj
D HOME^%ZIS D KILL^AQAOUTIL Q
AQAOPC1 ; IHS/ORDC/LJF - OCC BY INDICATOR W/ CRITERIA ;
+1 ;;1.01;QAI MANAGEMENT;;OCT 05, 1995
+2 ;
+3 ;This rtn contains the user interface for the trending report by
+4 ;review criteria.
+5 ;
+6 ;intro text
DO CRIT^AQAOHOP2
TYPE ; >>> ask user what type of report to print
+1 KILL DIR
SET DIR(0)="SO^L:LISTING PLUS STATISTICS;S:STATISTICS ONLY"
+2 SET DIR("A")="Choose TYPE of report to print"
+3 SET DIR("?",1)="Which report style do you want?"
+4 SET DIR("?",2)=" Enter L to list occurrences PLUS statistics"
+5 SET DIR("?",3)=" Enter S to print the statistical page ONLY"
+6 SET DIR("?")="For more information on these styles, see the User Manual."
+7 DO ^DIR
IF $DATA(DIRUT)
GOTO END
SET AQAOTYP=Y
+8 ;
IND ; >>> occurrences for which indicator?
+1 SET AQAOIND=$$IND^AQAOLKP
IF AQAOIND=U
GOTO END
IF AQAOIND=-1
GOTO TYPE
+2 SET AQAOIND=+AQAOIND
+3 ;
CRIT ; >>> check criteria defined for this indicator
+1 IF '$DATA(^AQAO1(6,"C",AQAOIND))
Begin DoDot:1
+2 WRITE !!,*7,"NO Criteria for this Indicator",!
End DoDot:1
GOTO TYPE
+3 ;init count; kill array & iom var
SET (X,AQAOCNT)=0
KILL AQAOCR,AQAOIOMX
+4 FOR
SET X=$ORDER(^AQAO1(6,"C",AQAOIND,X))
IF X=""
QUIT
Begin DoDot:1
+5 ;set array w/crit name
IF '$DATA(^AQAO1(6,X,0))
QUIT
SET AQAOCR(X)=$PIECE(^(0),U)
+6 ;increment count
SET AQAOCNT=AQAOCNT+1
End DoDot:1
+7 IF (AQAOTYP="L")
IF (AQAOCNT>7)
Begin DoDot:1
+8 SET AQAOIOMX=132
+9 WRITE !,*7,"You have more than 7 criteria for this indicator."
+10 WRITE !,"Please use CONDENSED PRINT or WIDE PAPER.",!
End DoDot:1
+11 ;
+12 ; >> if too many defined, must choose up to 14 for this report
+13 WRITE !!,"There are ",AQAOCNT," criteria defined for this indicator. Only"
+14 WRITE !,"14 can fit on the report. Please choose up to 14 from the list."
+15 WRITE !!
KILL DIR
SET DIR(0)="L^1:"_AQAOCNT_"^K:X#1 X"
SET (Y,X)=0
+16 FOR
SET X=$ORDER(AQAOCR(X))
IF X=""
QUIT
Begin DoDot:1
+17 SET Y=Y+1
SET DIR("A",Y)=Y_". "_AQAOCR(X)
SET AQAOAR(X)=Y
End DoDot:1
+18 SET DIR("A")="Choose the CRITERIA for this report"
DO ^DIR
+19 ;still too many
IF $DATA(DIRUT)
GOTO END
IF $PIECE(Y,",",15)'=""
GOTO CRIT
+20 ; >> kill off items not selected
+21 FOR I=1:1
SET X=$PIECE(Y,",",I)
IF X=""
QUIT
SET Y(X)=""
+22 SET X=0
FOR
SET X=$ORDER(AQAOCR(X))
IF X=""
QUIT
IF '$DATA(Y(AQAOAR(X)))
KILL AQAOCR(X)
+23 KILL Y,AQAOAR
+24 ;
DATES ; >> ask user to choose date range
+1 SET AQAOBD=$$BDATE^AQAOLKP
IF AQAOBD=U
GOTO IND
IF AQAOBD=""
GOTO IND
+2 SET AQAOED=$$EDATE^AQAOLKP
IF AQAOED=U
GOTO DATES
IF AQAOED=""
GOTO DATES
+3 ;
+4 ;
DEV ; >>> get print device
+1 IF $PIECE(AQAOUA("USER"),U,7)=1
DO EXPORT^AQAOUTIL
IF Y=U
GOTO DATES
+2 WRITE !!
+3 IF $DATA(AQAOIOMX)
WRITE *7,"REMEMBER to use CONDENSED PRINT or WIDE PAPER!",!!
+4 SET %ZIS="QP"
DO ^%ZIS
IF POP
GOTO END
+5 IF '$DATA(IO("Q"))
USE IO
GOTO ^AQAOPC11
+6 KILL IO("Q")
SET ZTRTN="^AQAOPC11"
SET ZTDESC="OCC BY IND & CRIT"
+7 FOR I="AQAOTYP","AQAOIND","AQAOCR(","AQAOBD","AQAOED"
SET ZTSAVE(I)=""
+8 IF $DATA(AQAODLM)
SET ZTSAVE("AQAODLM")=""
+9 IF $DATA(AQAOIOMX)
SET ZTSAVE("AQAOIOMX")=""
+10 IF $DATA(AQAOXSN)
SET ZTSAVE("AQAOXSN")=""
SET ZTSAVE("AQAOXSM")=""
+11 IF $DATA(AQAOXS)
SET ZTSAVE("AQAOXS(")=""
+12 DO ^%ZTLOAD
KILL ZTSK
DO ^%ZISC
+13 ;
END ; >>> eoj
+1 DO HOME^%ZIS
DO KILL^AQAOUTIL
QUIT