Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: APCDAGOL

APCDAGOL.m

Go to the documentation of this file.
APCDAGOL ; IHS/CMI/LAB - PROMPT FOR PROBLEM ;
 ;;2.0;IHS PCC SUITE;**7**;MAY 14, 2009
 ;
START ;
 NEW DA,DIR
 S DIR(0)="9000093,.01",DIR("A")="Enter INITIAL GOAL Setting" KILL DA D ^DIR KILL DIR
 I $D(DIRUT) S APCDTSKI=1,APCDLOOK="" Q
 G:Y="" XIT
 S APCDLOOK=Y
XIT K Y,X,DO,D,DD,DIPGM,APCDIGS
 Q
PG ;EP
 I $G(APCDDATE)="" S APCDDATE=DT
 I $G(APCDLOC)="" S APCDLOC=DUZ(2)
 S DFN=APCDPAT,Y=APCDPAT D ^AUPNPAT K Y
 S APCDPLL=APCDLOC,APCDPLD=$P(APCDDATE,".")
 S APCDPLV=$G(APCDVSIT)
 D EN^XBNEW("PL1^APCDAGOL","DFN;APCDPLL;APCDPLD;APCDPLV;VALM*")
 Q
PL1 ;EP
 D TERM^VALM0
 D ENDE^APCDPG
 Q
NON ;EP called from APCD NO (ADD) template
 D ^XBNEW("NO^APCDAGOL:APCD*")
 Q
STP ;EP called from APCD PO (ADD) template
 NEW APCDADDP
 S APCDADDP=1
 D ^XBNEW("NO1^APCDAGOL:APCD*")
 Q
NO ;EP add a step to a goal
 K DIR,DIRUT S DIR(0)="F^1:12",DIR("A")="Enter Goal Number" K DA D ^DIR K DIR
 G:$D(DIRUT) NOX
 S APCDPR=Y
 D ^APCDPLK
 I APCDPERR=1 W $C(7),$C(7),"Not a valid problem number.",! K APCDPERR G NO
 ;display existing notes, get next note number
NO1 ;EP
 S APCDGOAL=APCDPIEN
 I $O(^AUPNGOAL(APCDGOAL,21,0)) D
 .W !,"Steps:  " S APCDL=0 F  S APCDL=$O(^AUPNGOAL(APCDGOAL,21,APCDL)) Q:APCDL'=+APCDL  I $O(^AUPNGOAL(APCDGOAL,21,APCDL,11,0)) W !?3,$P(^DIC(4,$P(^AUPNGOAL(APCDGOAL,21,APCDL,0),U),0),U) D
 ..S APCDX=0 F  S APCDX=$O(^AUPNGOAL(APCDGOAL,21,APCDL,11,APCDX)) Q:APCDX'=+APCDX  D
 ...Q:$P(^AUPNGOAL(APCDGOAL,21,APCDL,11,APCDX,0),U,9)="D"
 ...W !?5,"Step#",$P(^AUPNGOAL(APCDGOAL,21,APCDL,11,APCDX,0),U)," ",$P($G(^AUPNGOAL(APCDGOAL,21,APCDL,11,APCDX,11)),U,1)
 ...W !?12,"Status: ",$$EXTSET^XBFUNC(9000093.211101,.09,$P(^AUPNGOAL(APCDGOAL,21,APCDL,11,APCDX,0),U,9)),?39,"Start: ",$$DATE^APCDPG($P(^AUPNGOAL(APCDGOAL,21,APCDL,11,APCDX,0),U,5))
 ...W ?56,"F/U: ",$$DATE^APCDPG($P(^AUPNGOAL(APCDGOAL,21,APCDL,11,APCDX,0),U,6))
 ...;S X=$P(^AUPNGOAL(APCDGOAL,21,APCDL,11,APCDX,0),U,4) I X S X=$P(^APCDPTGT(X,0),U,1) W ?64,"Type: ",X
 W ! S DIR(0)="Y",DIR("A")="Add a new Step for this Goal",DIR("B")="N" K DA D ^DIR K DIR
 G:$D(DIRUT) NOX
 G:Y=0 NOX
 ;get next step number
NUM ;
 ;add location multiple if necessary, otherwise get ien in multiple
 S APCDNIEN=$O(^AUPNGOAL(APCDGOAL,21,"B",APCDLOC,0))
 I APCDNIEN="" S X="`"_APCDLOC,DIC="^AUPNGOAL("_APCDGOAL_",21,",DA(1)=APCDGOAL,DIC(0)="L",DIC("P")=$P(^DD(9000093,2100,0),U,2) D ^DIC K DIC,DA,DR,Y,X S APCDNIEN=$O(^AUPNGOAL(APCDGOAL,21,"B",APCDLOC,0))
 I APCDNIEN="" W $C(7),$C(7),"ERROR UPDATING STEP LOCATION MULTIPLE" G NOX
 S (Y,X)=0 F  S Y=$O(^AUPNGOAL(APCDGOAL,21,APCDNIEN,11,"B",Y)) S:Y X=Y I 'Y S X=X+1 K Y Q
 S APCDNUM=X
 W !!,"Adding ",$P(^DIC(4,APCDLOC,0),U)," Step #",X
 K DIC S X=APCDNUM,DA(1)=APCDNIEN,DA(2)=APCDGOAL,DIC="^AUPNGOAL("_APCDGOAL_",21,"_APCDNIEN_",11,",DIC("P")=$P(^DD(9000093.21,1101,0),U,2),DIC(0)="L" D ^DIC K DA,DR
 I Y=-1 W !!,$C(7),$C(7),"ERROR when updating step number multiple",! G NOX
 S DIE=DIC K DIC W ?10 S %=$S($G(APCDDATE):$P(APCDDATE,"."),1:DT),DA=+Y,DR=".02////^S X=DUZ;.03////^S X=%;.07////^S X=DUZ;.08////^S X=$$NOW^XLFDT;1101;.04;.05;.06;.09////A;.1" D ^DIE K DIE,DR,DA,Y W !!
 G NO1
NOX ;
 K Y,APCDGOAL,X,L,APCDNUM,APCDNIEN,DIC,DA,DD
 Q