AQAOAPA ; IHS/ORDC/LJF - ENTER NEW ACTION PLAN ;
;;1.01;QAI MANAGEMENT;;OCT 05, 1995
;
;This rtn contains code for user interface in adding a new action
;plan or editing one already created.
;
INDICATR ; >>> ask user for indicator tied to this action plan
S AQAOIND=$$IND^AQAOLKP G EXIT:AQAOIND=U,EXIT:AQAOIND<1
S AQAOINDN=$P(AQAOIND,U,2),AQAOIND=+AQAOIND
;
CATEGORY ; >>> ask user for action category to be tied to this action plan
W !! K DIR S DIR(0)="PO^9002168.6:EMZQ"
S DIR("A")="Select ACTION CATEGORY"
D ^DIR G INDICATR:X="",EXIT:$D(DIRUT),CATEGORY:Y=-1
S AQAOCT=+Y,AQAOCTN=$P(Y,U,2)
;
NUMBER ; >>> get new action plan number
S AQAOAPN=$$NEWAP^AQAOCID
I AQAOAPN="" D G EXIT
.W !!,"COULD NOT GENERATE ACTION PLAN #; SEE SITE MANAGER"
W !!!,"I will create Action Plan #",AQAOAPN,": ",AQAOCTN
W !?40,"For INDICATOR: ",AQAOINDN,!
;
ASK ; >>> ask if user is sure wants to add plan
W !! K DIR S DIR(0)="YO",DIR("B")="YES"
S DIR("A")="ARE YOU SURE YOU WISH TO ADD THIS ACTION PLAN"
D ^DIR G EXIT:$D(DIRUT),INDICATR:Y=0
;
ADDPLAN ; >>> add action plan
K DD,DO,DIC S X=AQAOAPN,DIC="^AQAO(5,",DIC(0)=""
S DIC("DR")=".02////"_AQAOCT_";.05////1;.08////"_DUZ_";.09////"_DT_";.12////"_DUZ(2)_";.14////"_AQAOIND
L +(^AQAO(5,0)):1 I '$T D G EXIT
. W !!,*7,"CANNOT ADD; ANOTHER USER IS ADDING. TRY AGAIN.",!
D FILE^DICN L -(^AQAO(5,0)) S AQAOPLAN=+Y
;
EDITPLAN ; >> drop user into editing the action plan
W !! L +^AQAO(5,AQAOPLAN):1 I '$T D G EXIT
.W !!,"CANNOT EDIT; ANOTHER USER EDITING THIS ACTION PLAN.",!
K DIE S DIE="^AQAO(5,",DA=AQAOPLAN,DR="[AQAO PLAN EDIT]" D ^DIE
L -^AQAO(5,AQAOPLAN) G EXIT:$D(DTOUT),EXIT:$D(DUOUT)
W !!,"ACTION PLAN CREATION COMPLETE . . ",!! G INDICATR
;
EXIT ; >> eoj
D KILL^AQAOUTIL Q
;
;
EDIT ;ENTRY POINT for option to update action plan
;called by option AQAO ACTPLAN UPDATE
D UPDATE^AQAOHAPL
W !! K DIC S DIC="^AQAO(5,",DIC(0)="AEMZQ"
S DIC("S")="I $P(^AQAO(5,Y,0),U,6)="""" D ACTCHK^AQAOSEC I $D(AQAOCHK(""OK""))"
S DIC("A")="Enter ACTION PLAN NUMBER: "
D ^DIC K AQAOCHK("OK") W ! G EXIT:X="",EXIT:X=U,EDIT:Y=-1 S AQAOPLAN=+Y
;
; >> drop user into editing the action plan
W !! L +^AQAO(5,AQAOPLAN):1 I '$T D G EDIT
.W !!,"CANNOT EDIT; ANOTHER USER EDITING THIS ACTION PLAN.",!
K DIE S DIE="^AQAO(5,",DA=AQAOPLAN,DR="[AQAO PLAN EDIT]" D ^DIE
I $G(AQAOSTAT)>2,$G(AQAOSTAT)<9 D
.I $P(^AQAO(5,AQAOPLAN,0),U,4)]"",$P(^(0),U,4)>DT Q ;PATCH 3
.W !! K DIR S DIR(0)="Y",DIR("B")="YES"
.S DIR("A")="Do you wish to CLOSE this Action Plan"
.S DIR("?",1)="Answer YES to complete the processing of this plan."
.S DIR("?",2)="Answer NO to allow continued editing of this plan."
.S DIR("?",3)="Once closed, you must use the REOPEN option to edit"
.S DIR("?",4)="it further.",DIR("?")=" "
.D ^DIR Q:Y'=1
.S DIE="^AQAO(5,",DA=AQAOPLAN
.S DR=".06////"_DT_";.11////"_$P(^VA(200,DUZ,0),U) D ^DIE
.W !!,"ACTION CLOSED!",!
L -^AQAO(5,AQAOPLAN) G EXIT:$D(DTOUT),EXIT:$D(DUOUT)
D PRTOPT^AQAOVAR G EDIT
AQAOAPA ; IHS/ORDC/LJF - ENTER NEW ACTION PLAN ;
+1 ;;1.01;QAI MANAGEMENT;;OCT 05, 1995
+2 ;
+3 ;This rtn contains code for user interface in adding a new action
+4 ;plan or editing one already created.
+5 ;
INDICATR ; >>> ask user for indicator tied to this action plan
+1 SET AQAOIND=$$IND^AQAOLKP
IF AQAOIND=U
GOTO EXIT
IF AQAOIND<1
GOTO EXIT
+2 SET AQAOINDN=$PIECE(AQAOIND,U,2)
SET AQAOIND=+AQAOIND
+3 ;
CATEGORY ; >>> ask user for action category to be tied to this action plan
+1 WRITE !!
KILL DIR
SET DIR(0)="PO^9002168.6:EMZQ"
+2 SET DIR("A")="Select ACTION CATEGORY"
+3 DO ^DIR
IF X=""
GOTO INDICATR
IF $DATA(DIRUT)
GOTO EXIT
IF Y=-1
GOTO CATEGORY
+4 SET AQAOCT=+Y
SET AQAOCTN=$PIECE(Y,U,2)
+5 ;
NUMBER ; >>> get new action plan number
+1 SET AQAOAPN=$$NEWAP^AQAOCID
+2 IF AQAOAPN=""
Begin DoDot:1
+3 WRITE !!,"COULD NOT GENERATE ACTION PLAN #; SEE SITE MANAGER"
End DoDot:1
GOTO EXIT
+4 WRITE !!!,"I will create Action Plan #",AQAOAPN,": ",AQAOCTN
+5 WRITE !?40,"For INDICATOR: ",AQAOINDN,!
+6 ;
ASK ; >>> ask if user is sure wants to add plan
+1 WRITE !!
KILL DIR
SET DIR(0)="YO"
SET DIR("B")="YES"
+2 SET DIR("A")="ARE YOU SURE YOU WISH TO ADD THIS ACTION PLAN"
+3 DO ^DIR
IF $DATA(DIRUT)
GOTO EXIT
IF Y=0
GOTO INDICATR
+4 ;
ADDPLAN ; >>> add action plan
+1 KILL DD,DO,DIC
SET X=AQAOAPN
SET DIC="^AQAO(5,"
SET DIC(0)=""
+2 SET DIC("DR")=".02////"_AQAOCT_";.05////1;.08////"_DUZ_";.09////"_DT_";.12////"_DUZ(2)_";.14////"_AQAOIND
+3 LOCK +(^AQAO(5,0)):1
IF '$TEST
Begin DoDot:1
+4 WRITE !!,*7,"CANNOT ADD; ANOTHER USER IS ADDING. TRY AGAIN.",!
End DoDot:1
GOTO EXIT
+5 DO FILE^DICN
LOCK -(^AQAO(5,0))
SET AQAOPLAN=+Y
+6 ;
EDITPLAN ; >> drop user into editing the action plan
+1 WRITE !!
LOCK +^AQAO(5,AQAOPLAN):1
IF '$TEST
Begin DoDot:1
+2 WRITE !!,"CANNOT EDIT; ANOTHER USER EDITING THIS ACTION PLAN.",!
End DoDot:1
GOTO EXIT
+3 KILL DIE
SET DIE="^AQAO(5,"
SET DA=AQAOPLAN
SET DR="[AQAO PLAN EDIT]"
DO ^DIE
+4 LOCK -^AQAO(5,AQAOPLAN)
IF $DATA(DTOUT)
GOTO EXIT
IF $DATA(DUOUT)
GOTO EXIT
+5 WRITE !!,"ACTION PLAN CREATION COMPLETE . . ",!!
GOTO INDICATR
+6 ;
EXIT ; >> eoj
+1 DO KILL^AQAOUTIL
QUIT
+2 ;
+3 ;
EDIT ;ENTRY POINT for option to update action plan
+1 ;called by option AQAO ACTPLAN UPDATE
+2 DO UPDATE^AQAOHAPL
+3 WRITE !!
KILL DIC
SET DIC="^AQAO(5,"
SET DIC(0)="AEMZQ"
+4 SET DIC("S")="I $P(^AQAO(5,Y,0),U,6)="""" D ACTCHK^AQAOSEC I $D(AQAOCHK(""OK""))"
+5 SET DIC("A")="Enter ACTION PLAN NUMBER: "
+6 DO ^DIC
KILL AQAOCHK("OK")
WRITE !
IF X=""
GOTO EXIT
IF X=U
GOTO EXIT
IF Y=-1
GOTO EDIT
SET AQAOPLAN=+Y
+7 ;
+8 ; >> drop user into editing the action plan
+9 WRITE !!
LOCK +^AQAO(5,AQAOPLAN):1
IF '$TEST
Begin DoDot:1
+10 WRITE !!,"CANNOT EDIT; ANOTHER USER EDITING THIS ACTION PLAN.",!
End DoDot:1
GOTO EDIT
+11 KILL DIE
SET DIE="^AQAO(5,"
SET DA=AQAOPLAN
SET DR="[AQAO PLAN EDIT]"
DO ^DIE
+12 IF $GET(AQAOSTAT)>2
IF $GET(AQAOSTAT)<9
Begin DoDot:1
+13 ;PATCH 3
IF $PIECE(^AQAO(5,AQAOPLAN,0),U,4)]""
IF $PIECE(^(0),U,4)>DT
QUIT
+14 WRITE !!
KILL DIR
SET DIR(0)="Y"
SET DIR("B")="YES"
+15 SET DIR("A")="Do you wish to CLOSE this Action Plan"
+16 SET DIR("?",1)="Answer YES to complete the processing of this plan."
+17 SET DIR("?",2)="Answer NO to allow continued editing of this plan."
+18 SET DIR("?",3)="Once closed, you must use the REOPEN option to edit"
+19 SET DIR("?",4)="it further."
SET DIR("?")=" "
+20 DO ^DIR
IF Y'=1
QUIT
+21 SET DIE="^AQAO(5,"
SET DA=AQAOPLAN
+22 SET DR=".06////"_DT_";.11////"_$PIECE(^VA(200,DUZ,0),U)
DO ^DIE
+23 WRITE !!,"ACTION CLOSED!",!
End DoDot:1
+24 LOCK -^AQAO(5,AQAOPLAN)
IF $DATA(DTOUT)
GOTO EXIT
IF $DATA(DUOUT)
GOTO EXIT
+25 DO PRTOPT^AQAOVAR
GOTO EDIT