AQAOPA5 ; IHS/ORDC/LJF - REVIEWED ACTIONS REPORT ;
;;1.01;QAI MANAGEMENT;;OCT 05, 1995
;
;This rtn includes the user interface and DIP call to print a listing
;of reviewed actions sorted in various ways.
;
TYPE ; >> choose listing vs summaries
W !! K DIR S DIR(0)="SO^L:BRIEF LISTING;S:FULL SUMMARIES"
S DIR("A")="Choose TYPE of Report to Print" D ^DIR
G END:X="",END:$D(DIRUT),END:Y=-1
I Y="L" S FLDS="[AQAO REVIEWED]"
E S FLDS="[AQAO REVIEWED WITH SUM]"
;
SORT ; >>> choose sorting order for report
W !! K DIR S DIR(0)="SO^",DIR("A")="Choose SORT ORDER for Report"
F X=1:1:5 S DIR(0)=DIR(0)_X_":By "_$P($T(RPT+X),";;",2)_";"
S DIR(0)=$E(DIR(0),1,$L(DIR(0))-1)
D ^DIR G END:$D(DIRUT),SORT:X="",END:Y=-1 S AQAORPT=+Y
S BY=$P($T(RPT+Y),";;",3) ;set sort order
I FLDS="[AQAO REVIEWED WITH SUM]" D
.S BY=$S(AQAORPT=1:"#"_BY,1:BY_",#ACTION NUMBER")
I AQAORPT=1 S AQAOSRT="?" G PRINT ;no other ques for sort by plan #
;
CHOOSE ; >>> choose all or just one entry
K DIR S DIR(0)="Y",DIR("B")="NO"
S DIR("A")="Do you wish to print ALL "_$P($T(RPT+AQAORPT),";;",2)_"S"
D ^DIR G END:$D(DIRUT)
I (AQAORPT=3)!(AQAORPT=4) G BDATE:Y=0 S AQAOSRT="" G PRINT
I Y=1 S AQAOSRT="" G PRINT
;
K DIC S DIC=$P($T(RPT+AQAORPT),";;",4),DIC(0)="AEQMZ" D ^DIC
G TYPE:$D(DIRUT),CHOOSE:Y=-1
S AQAOSRT=$P(Y,U,2) G PRINT
;
BDATE ; >>> choose beginning date for report
W !! K DIR S DIR(0)="DO^::EX"
S DIR("A")="Select BEGINNING "_$P($T(RPT+AQAORPT),";;",3)
D ^DIR I Y>DT W *7," NO FUTURE DATES" G BDATE
G TYPE:X="",END:$D(DIRUT),BDATE:Y=-1 S FR=Y
;
EDATE ; >>> choose ending occurrence date for report
W ! K DIR S DIR(0)="DO^::EX"
S DIR("A")="Select ENDING "_$P($T(RPT+AQAORPT),";;",3)
D ^DIR I Y=-1 G EDATE
I Y>DT W *7," NO FUTURE DATES" G EDATE
I Y<FR W *7," ENDING DATE MUST BE AFTER BEGINNING DATE" G BDATE
G BDATE:X="",END:$D(DIRUT),EDATE:Y=-1 S TO=Y
;
;
; >>> FIND DATA FOR SELECTED REPORT <<<
PRINT ; >>> set up variables for dip call
K DIC S DIC="^AQAO(5,",L=0 S:'$D(FR) (TO,FR)=AQAOSRT
S DIS(0)="I ($P(^AQAO(5,D0,0),U,5)=3)!($P(^(0),U,5)=4)!($P(^(0),U,5)=5)"
S DIS(1)="S Y=D0 D ACTCHK^AQAOSEC I $D(AQAOCHK(""OK""))"
D EN1^DIP K AQAOCHK("OK")
;
;
I IOST["C-" D PRTOPT^AQAOVAR
;
END D ^%ZISC,KILL^AQAOUTIL Q
;
;
RPT ;;
;;ACTION PLAN #;;ACTION NUMBER;;^AQAO(5,;;
;;ACTION TYPE;;@ACTION TYPE;;^AQAO(6,;;
;;IMPLEMENTATION DATE;;IMPLEMENTATION DATE;;
;;REVIEW DATE;;PROPOSED REVIEW DATE;;
;;IMPLEMENTATION TEAM;;IMPLEMENTATION TEAMS,IMPLEMENTATION TEAM;;^AQAO1(1,;;
AQAOPA5 ; IHS/ORDC/LJF - REVIEWED ACTIONS REPORT ;
+1 ;;1.01;QAI MANAGEMENT;;OCT 05, 1995
+2 ;
+3 ;This rtn includes the user interface and DIP call to print a listing
+4 ;of reviewed actions sorted in various ways.
+5 ;
TYPE ; >> choose listing vs summaries
+1 WRITE !!
KILL DIR
SET DIR(0)="SO^L:BRIEF LISTING;S:FULL SUMMARIES"
+2 SET DIR("A")="Choose TYPE of Report to Print"
DO ^DIR
+3 IF X=""
GOTO END
IF $DATA(DIRUT)
GOTO END
IF Y=-1
GOTO END
+4 IF Y="L"
SET FLDS="[AQAO REVIEWED]"
+5 IF '$TEST
SET FLDS="[AQAO REVIEWED WITH SUM]"
+6 ;
SORT ; >>> choose sorting order for report
+1 WRITE !!
KILL DIR
SET DIR(0)="SO^"
SET DIR("A")="Choose SORT ORDER for Report"
+2 FOR X=1:1:5
SET DIR(0)=DIR(0)_X_":By "_$PIECE($TEXT(RPT+X),";;",2)_";"
+3 SET DIR(0)=$EXTRACT(DIR(0),1,$LENGTH(DIR(0))-1)
+4 DO ^DIR
IF $DATA(DIRUT)
GOTO END
IF X=""
GOTO SORT
IF Y=-1
GOTO END
SET AQAORPT=+Y
+5 ;set sort order
SET BY=$PIECE($TEXT(RPT+Y),";;",3)
+6 IF FLDS="[AQAO REVIEWED WITH SUM]"
Begin DoDot:1
+7 SET BY=$SELECT(AQAORPT=1:"#"_BY,1:BY_",#ACTION NUMBER")
End DoDot:1
+8 ;no other ques for sort by plan #
IF AQAORPT=1
SET AQAOSRT="?"
GOTO PRINT
+9 ;
CHOOSE ; >>> choose all or just one entry
+1 KILL DIR
SET DIR(0)="Y"
SET DIR("B")="NO"
+2 SET DIR("A")="Do you wish to print ALL "_$PIECE($TEXT(RPT+AQAORPT),";;",2)_"S"
+3 DO ^DIR
IF $DATA(DIRUT)
GOTO END
+4 IF (AQAORPT=3)!(AQAORPT=4)
IF Y=0
GOTO BDATE
SET AQAOSRT=""
GOTO PRINT
+5 IF Y=1
SET AQAOSRT=""
GOTO PRINT
+6 ;
+7 KILL DIC
SET DIC=$PIECE($TEXT(RPT+AQAORPT),";;",4)
SET DIC(0)="AEQMZ"
DO ^DIC
+8 IF $DATA(DIRUT)
GOTO TYPE
IF Y=-1
GOTO CHOOSE
+9 SET AQAOSRT=$PIECE(Y,U,2)
GOTO PRINT
+10 ;
BDATE ; >>> choose beginning date for report
+1 WRITE !!
KILL DIR
SET DIR(0)="DO^::EX"
+2 SET DIR("A")="Select BEGINNING "_$PIECE($TEXT(RPT+AQAORPT),";;",3)
+3 DO ^DIR
IF Y>DT
WRITE *7," NO FUTURE DATES"
GOTO BDATE
+4 IF X=""
GOTO TYPE
IF $DATA(DIRUT)
GOTO END
IF Y=-1
GOTO BDATE
SET FR=Y
+5 ;
EDATE ; >>> choose ending occurrence date for report
+1 WRITE !
KILL DIR
SET DIR(0)="DO^::EX"
+2 SET DIR("A")="Select ENDING "_$PIECE($TEXT(RPT+AQAORPT),";;",3)
+3 DO ^DIR
IF Y=-1
GOTO EDATE
+4 IF Y>DT
WRITE *7," NO FUTURE DATES"
GOTO EDATE
+5 IF Y<FR
WRITE *7," ENDING DATE MUST BE AFTER BEGINNING DATE"
GOTO BDATE
+6 IF X=""
GOTO BDATE
IF $DATA(DIRUT)
GOTO END
IF Y=-1
GOTO EDATE
SET TO=Y
+7 ;
+8 ;
+9 ; >>> FIND DATA FOR SELECTED REPORT <<<
PRINT ; >>> set up variables for dip call
+1 KILL DIC
SET DIC="^AQAO(5,"
SET L=0
IF '$DATA(FR)
SET (TO,FR)=AQAOSRT
+2 SET DIS(0)="I ($P(^AQAO(5,D0,0),U,5)=3)!($P(^(0),U,5)=4)!($P(^(0),U,5)=5)"
+3 SET DIS(1)="S Y=D0 D ACTCHK^AQAOSEC I $D(AQAOCHK(""OK""))"
+4 DO EN1^DIP
KILL AQAOCHK("OK")
+5 ;
+6 ;
+7 IF IOST["C-"
DO PRTOPT^AQAOVAR
+8 ;
END DO ^%ZISC
DO KILL^AQAOUTIL
QUIT
+1 ;
+2 ;
RPT ;;
+1 ;;ACTION PLAN #;;ACTION NUMBER;;^AQAO(5,;;
+2 ;;ACTION TYPE;;@ACTION TYPE;;^AQAO(6,;;
+3 ;;IMPLEMENTATION DATE;;IMPLEMENTATION DATE;;
+4 ;;REVIEW DATE;;PROPOSED REVIEW DATE;;
+5 ;;IMPLEMENTATION TEAM;;IMPLEMENTATION TEAMS,IMPLEMENTATION TEAM;;^AQAO1(1,;;