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

APSPDUEN.m

Go to the documentation of this file.
APSPDUEN ; IHS/DSD/ENM - CREATE NEW APSP DUE REVIEW ENTRIES ;  [ 09/03/97   1:30 PM ]
 ;;6.0;IHS PHARMACY MODIFICATIONS;;09/03/97
 ;
 ;--------------------------------------------------------------
START ;
 D ADD ; Create new entry in File
 G:APSPDUEN("QUIT") END
 D EDIT ; Creates DUE STUDY CRITERIA entries in multiple
 D CRITERIA ; Answer questions about Criteria
 G START
END D EOJ ; Clean up variables
 Q
 ;---------------------------------------------------------------
 ;
ADD ;
 S APSPDUEN("QUIT")=0
 S DIC(0)="QEAML",DIC="^APSPDUE(32,",DIADD="",DIC("DR")=".01:.07"
 D ^DIC K DIC,DIADD
 I Y=-1 S APSPDUEN("QUIT")=1 G ADDX
 S APSPDUEN("CN")=$P(^APSPDUE(32,+Y,0),U,2)
ADDX ;
 Q
 ;
EDIT S DIE="^APSPDUE(32,",APSPDUEN("STOP")=0,APSPDUEN("X")=0,APSPDUEN("DA")=APSPDUEN("CN") F  S APSPDUEN("X")=$O(^APSPDUE(32.1,APSPDUEN("DA"),11,APSPDUEN("X"))) Q:APSPDUEN("X")'=+APSPDUEN("X")!(APSPDUEN("STOP"))  D
 . S DR="1100///`"_APSPDUEN("X")
 . S DR(2,9009032.011)=".02////"
 . D ^DIE I $D(Y) S APSPDUEN("STOP")=1
 Q
CRITERIA ;
 S APSPDUEN("STOP")=0,APSPDUEN("X")=0,APSPDUEN("DA")=DA,DIC(0)="ENF",(DIC,DIE)="^APSPDUE(32,APSPDUEN(""DA""),11," F  S APSPDUEN("X")=$O(^APSPDUE(32,APSPDUEN("DA"),11,APSPDUEN("X"))) Q:APSPDUEN("X")'=+APSPDUEN("X")!(APSPDUEN("STOP"))  W ! D
 . S X=APSPDUEN("X")
 . F APSPWP=0:0 S APSPWP=$O(^APSPDUE(32.2,X,11,APSPWP)) Q:APSPWP'=+APSPWP  W !,^APSPDUE(32.2,X,11,APSPWP,0)
 . S DR=".02",DA(1)=1,DA=APSPDUEN("X") D ^DIE I $D(Y) S APSPDUEN("STOP")=1
 S DA=APSPDUEN("DA"),DIE="^APSPDUE(32,",DR=".08;1200" D ^DIE
 Q
EOJ ;
 K APSPDUEN,DIE,DIC,DR,X,Y,DA,D0,APSPWP
 Q