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

AZXZSUP.m

Go to the documentation of this file.
AZXZSUP ;SUPPORT DATABASE PROGRAM [ 05/01/95   1:25 PM ]
 ;04/01/92   JOHN H. LYNCH
 ;
 ;A TOOL USED FOR RECORDING AND TRACKING
 ;SUPPORT CALLS FROM SERVICE UNITS UNDER
 ;PHOENIX AREA INDIAN HEALTH SERVICE.
 
MAIN ;AZXZSUP PROGRAM CONTROL
 ;SET LOCAL VARIABLES
 ;D ^XBKSET  ;THIS LINE SHOULD BE UNCOMMENTED IF RUNNING IN
             ;PROGRAMMERS' MODE ONLY!
 
 D MAINMENU
 K OPTION,DIE("NO^"),SNUM,DIE,INUM,TCOUNT,DA,LOOK,DR,YN,PIEC
 Q
 
 ;CLEAR SCREEN
 W @IOF
 
 W !!!,?27,"RPMS Support Database"
 W !,?21,"Phoenix Area Indian Health Service"
 W !!!,?21,"Enter/Edit Support Calls.......[1]"
 W !,?21,"Delete Support Calls...........[2]"
 W !,?21,"Update Status of Support Calls.[3]"
 W !,?21,"For Future Use.................[4]"
 W !,?21,"Quit...........................[5]"
 W !!,?33,"Option: " R OPTION
 I OPTION=1 D ENTRY G MAINMENU  
 I OPTION=2 D ^AZXZSUP1 G MAINMENU
 I OPTION=3 D ^AZXZSUP2 G MAINMENU
 I OPTION=4 G MAINMENU
 I (OPTION=5)!(OPTION="")!(OPTION="^") Q  
 G MAINMENU
 Q
 
ENTRY ;ENTER/EDIT SUPPORT CALLS ROUTINE
 ;SET LOCAL VARIABLES
 S DIE("NO^")="NO JUMPING/EXIT" ;KEEP THEM FROM JUMPING OR EXITING
 S DIE="1991012"  ;1991012 = ^SUPPDB (DATABASE GLOBAL)
 
 ;CLEAR SCREEN
 W @IOF
 
 W !!!,"ONE MOMENT PLEASE..."
 W !!!!  H 1
 
SUPPNUM ;Select SUPPORT NUMBER:  SUB-ROUTINE
 ;SET LOCAL VARIABLES
 S INUM=$P(^DIZ(DIE,0),U,3) ;INUM = CURRENT INTERNAL NUMBER
 S TCOUNT=$P(^DIZ(DIE,0),U,4) ;TCOUNT = TOTAL COUNT CURR. IN FILE
 
 W !,"Select Support Number: ",INUM+1,"// "
 R SNUM
 
 ;USER CHOOSING DEFAULT AS NEW ENTRY
 I SNUM="" S SNUM=INUM+1
 
 ;IF "^" QUIT AND RETURN TO MAINMENU
 I SNUM="^"  Q
 
 ;IF "?" GIVE HELP AND RETURN TO SUPPNUM SUB-ROUTINE
 I SNUM="?" W !!,"Please enter your support log number or press return and accept the default for a new entry.",! G SUPPNUM
 
 ;ACCEPT SNUM AS A NEW ENTRY - INCREMENT COUNTERS IN ^DIZ(DIE,0)
 I (SNUM=(INUM+1)) S $P(^DIZ(DIE,0),U,3)=INUM+1,$P(^DIZ(DIE,0),U,4)=TCOUNT+1 
 ;USER IS TRYING TO ENTER A NUMBER OUT OF SEQUENCE
 I SNUM>(INUM+1)  W !!,"SKIPPING SUPPORT NUMBERS IS NOT ALLOWED!",*7 H 3 G ENTRY
 ;LOOK UP USER INPUT TO SEE IF IT EXISTS - IF NOT SAY ITS BEEN DELETED
 S PIEC=0
 I (SNUM<(INUM+1))&('$O(^DIZ(DIE,"B",SNUM,PIEC))) W !!,"SUPPORT NUMBER, ",SNUM,", HAS ALREADY BEEN DELETED!",! H 3 G SUPPNUM
 
 S DA=SNUM
 S DR=".01///^S X=DA;.05:7"     ;DR - STUFF .01(SUPPORT NUMBER)
 ;CALL FILEMAN TO ENTER/EDIT ^SUPPDB (DATABASE GLOBAL)
 L ^DIZ(DIE,DA):0 I '$T  W !!,"RECORD HAS BEEN LOCKED, TRY AGAIN LATER!",!  H 3 G SUPPNUM
 D ^DIE L  
 
 W !!!!
 R !,"DO YOU WANT TO CONTINUE WITH ENTER/EDIT? Y// ",YN
 
 I (YN="Y")!(YN="") G ENTRY  ;STAY IN ENTRY SUB-ROUNTINE
 Q                           ;OTHERWISE RETURN TO MAINMENU