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

DGPMDEF.m

Go to the documentation of this file.
  1. DGPMDEF ;ALB/MRL/MIR - STORE STANDARD MOVEMENT DEFAULT VALUES; 13 OCT 88
  1. ;;5.3;Registration;**107**;Aug 13, 1993
  1. ;
  1. W !! F I=1:1 S J=$P($T(T+I),";;",2) Q:J="QUIT" W !,J
  1. S DLAYGO=405.1,(DIC,DIE)="^DG(405.1," F DGI=0:0 S DIC(0)="AELMQZ",DR=".01:.04;S:$P(^DG(405.1,DA,0),""^"",2)'=2 Y=.07;.05;.07;10" W !! D ^DIC Q:Y<0 S DA=+Y D ^DIE S ^UTILITY("DGPMDEF",$J,DA)=""
  1. I '$D(^UTILITY("DGPMDEF",$J)) G QUIT
  1. ASK W !!,"Store standard defaults for (A)ll movement types,",!?5,"those just (E)dited, or (N)one? A//" R X:DTIME I '$T!(X["^") G QUIT
  1. I X="" S X="A"
  1. S Z="^ALL^EDIT^NONE^" D IN^DGHELP I %<0 W !!?5,"A - Store defaults for all movement types",!?5,"E - Store defaults for those movement types you edited",!?5,"N - Don't store any standard defaults" G ASK
  1. S DGHOW=X
  1. I DGHOW'="N" S ZTRTN="DQ^DGPMDEF" D NOW^%DTC S ZTDTH=%,ZTSAVE("DGHOW")="",ZTSAVE("^UTILITY(""DGPMDEF"",$J,")="",ZTDESC="STORE STANDARD DEFAULT MOVEMENT TYPES",ZTIO="" D ^%ZTLOAD W !!,"...Queued!"
  1. QUIT K %,I,J,Y,DA,DGC,DGF,DGHOW,DGI,DGJ,DGK,DGM,DGX,DGX1,DGX2,DGY,DIC,DIE,DIK,DLAYGO,DR,^UTILITY("DGPMDEF",$J),X,Z,ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE
  1. Q
  1. ;
  1. ;
  1. DQ ;dequeue task
  1. I DGHOW="A" F DGJ=0:0 S DGJ=$O(^DG(405.1,DGJ)) Q:'DGJ I $D(^DG(405.1,+DGJ,0)) S DGX=^(0) D M1
  1. I DGHOW="A" G Q
  1. F DGJ=0:0 S DGJ=$O(^UTILITY("DGPMDEF",$J,DGJ)) Q:'DGJ I $D(^DG(405.1,+DGJ,0)) S DGX=^(0) D M1,COF
  1. Q D QUIT
  1. Q
  1. ;
  1. M1 S DGX2=+$P(DGX,"^",3),DGX1=$S($D(^DG(405.2,+DGX2,0)):^(0),1:"") Q:DGX1']""
  1. S DR=".05///"_+$P(DGX1,"^",5),DA=DGJ,DIE="^DG(405.1,",DIC(0)="L" D ^DIE K DR,DIE,DIC
  1. G IX:$O(^DG(405.2,+DGX2,"F",0))="" S DGC=0 F DGK=0:0 S DGK=$O(^DG(405.1,+DGJ,"F",DGK)) Q:'DGK S DA(1)=DGJ,DA=DGK,DIK="^DG(405.1,"_DGJ_",""F""," D ^DIK
  1. F DGM=0:0 S DGM=$O(^DG(405.2,+DGX2,"F",DGM)) Q:'DGM F DGF=0:0 S DGF=$O(^DG(405.1,"AM",+DGM,DGF)) Q:'DGF S ^DG(405.1,+DGJ,"F",+DGF,0)=+DGF,DGC=DGC+1
  1. S ^DG(405.1,DGJ,"F",0)="^405.11P^"_DGF_"^"_DGC
  1. IX S DA=DGJ,DIK="^DG(405.1," D IX^DIK Q
  1. ;
  1. COF ;if only updating some movement types, update the can only follows, too
  1. ;DGX2=IFN of corresponding MAS MOVEMENT TYPE - set in line M1
  1. ;DGJ=IFN of FACILITY MOVEMENT TYPE
  1. N DGMAS,DGLOC
  1. I '$D(^DG(405.2,+DGX2,0)) Q
  1. F DGMAS=0:0 S DGMAS=$O(^DG(405.2,"AF",DGX2,DGMAS)) Q:'DGMAS F DGLOC=0:0 S DGLOC=$O(^DG(405.1,"AM",DGMAS,DGLOC)) Q:'DGLOC I '$D(^DG(405.1,DGLOC,"F",DGJ)) D
  1. . K DA,DIC,DIK
  1. . S (DINUM,X)=DGJ,DA(1)=DGLOC
  1. . S DIC="^DG(405.1,"_DA(1)_",""F"",",DIC(0)="L",DIC("P")="405.11PA"
  1. . K DD,DO D FILE^DICN
  1. . K DINUM
  1. Q
  1. T ;
  1. ;;This option is used to enter or edit locally defined FACILITY MOVEMENT TYPE
  1. ;;entries as well as to place the standard (default) values in place for the
  1. ;;transaction types you select. The standard values are determined by the MAS
  1. ;;EP based on existing guidelines. The user may elect to place these standard
  1. ;;values into place using this option or selectively edit movement types and enter
  1. ;;values as desired by the local facility. To facilitate the process it is
  1. ;;recommended that, the first time through, you place the standard values and, if
  1. ;;not acceptable, edit the data which was stored. In all likelihood the standard
  1. ;;values will closely resemble what you desire anyway and considerable input time
  1. ;;will be saved.
  1. ;;QUIT