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
MAINMENU ;MAIN MENU OF OPTIONS
;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
AZXZSUP ;SUPPORT DATABASE PROGRAM [ 05/01/95 1:25 PM ]
+1 ;04/01/92 JOHN H. LYNCH
+2 ;
+3 ;A TOOL USED FOR RECORDING AND TRACKING
+4 ;SUPPORT CALLS FROM SERVICE UNITS UNDER
+5 ;PHOENIX AREA INDIAN HEALTH SERVICE.
+6 MAIN ;AZXZSUP PROGRAM CONTROL
+1 ;SET LOCAL VARIABLES
+2 ;D ^XBKSET ;THIS LINE SHOULD BE UNCOMMENTED IF RUNNING IN
+3 ;PROGRAMMERS' MODE ONLY!
+4 +5 DO MAINMENU
+6 KILL OPTION,DIE("NO^"),SNUM,DIE,INUM,TCOUNT,DA,LOOK,DR,YN,PIEC
+7 QUIT
+8 MAINMENU ;MAIN MENU OF OPTIONS
+1 ;CLEAR SCREEN
+2 WRITE @IOF
+3 +4 WRITE !!!,?27,"RPMS Support Database"
+5 WRITE !,?21,"Phoenix Area Indian Health Service"
+6 WRITE !!!,?21,"Enter/Edit Support Calls.......[1]"
+7 WRITE !,?21,"Delete Support Calls...........[2]"
+8 WRITE !,?21,"Update Status of Support Calls.[3]"
+9 WRITE !,?21,"For Future Use.................[4]"
+10 WRITE !,?21,"Quit...........................[5]"
+11 WRITE !!,?33,"Option: "
READ OPTION
+12 IF OPTION=1
DO ENTRY
GOTO MAINMENU
+13 IF OPTION=2
DO ^AZXZSUP1
GOTO MAINMENU
+14 IF OPTION=3
DO ^AZXZSUP2
GOTO MAINMENU
+15 IF OPTION=4
GOTO MAINMENU
+16 IF (OPTION=5)!(OPTION="")!(OPTION="^")
QUIT
+17 GOTO MAINMENU
+18 QUIT
+19 ENTRY ;ENTER/EDIT SUPPORT CALLS ROUTINE
+1 ;SET LOCAL VARIABLES
+2 ;KEEP THEM FROM JUMPING OR EXITING
SET DIE("NO^")="NO JUMPING/EXIT"
+3 ;1991012 = ^SUPPDB (DATABASE GLOBAL)
SET DIE="1991012"
+4 +5 ;CLEAR SCREEN
+6 WRITE @IOF
+7 +8 WRITE !!!,"ONE MOMENT PLEASE..."
+9 WRITE !!!!
HANG 1
+10 SUPPNUM ;Select SUPPORT NUMBER: SUB-ROUTINE
+1 ;SET LOCAL VARIABLES
+2 ;INUM = CURRENT INTERNAL NUMBER
SET INUM=$PIECE(^DIZ(DIE,0),U,3)
+3 ;TCOUNT = TOTAL COUNT CURR. IN FILE
SET TCOUNT=$PIECE(^DIZ(DIE,0),U,4)
+4 +5 WRITE !,"Select Support Number: ",INUM+1,"// "
+6 READ SNUM
+7 +8 ;USER CHOOSING DEFAULT AS NEW ENTRY
+9 IF SNUM=""
SET SNUM=INUM+1
+10 +11 ;IF "^" QUIT AND RETURN TO MAINMENU
+12 IF SNUM="^"
QUIT
+13 +14 ;IF "?" GIVE HELP AND RETURN TO SUPPNUM SUB-ROUTINE
+15 IF SNUM="?"
WRITE !!,"Please enter your support log number or press return and accept the default for a new entry.",!
GOTO SUPPNUM
+16 +17 ;ACCEPT SNUM AS A NEW ENTRY - INCREMENT COUNTERS IN ^DIZ(DIE,0)
+18 IF (SNUM=(INUM+1))
SET $PIECE(^DIZ(DIE,0),U,3)=INUM+1
SET $PIECE(^DIZ(DIE,0),U,4)=TCOUNT+1
+19 ;USER IS TRYING TO ENTER A NUMBER OUT OF SEQUENCE
+20 IF SNUM>(INUM+1)
WRITE !!,"SKIPPING SUPPORT NUMBERS IS NOT ALLOWED!",*7
HANG 3
GOTO ENTRY
+21 ;LOOK UP USER INPUT TO SEE IF IT EXISTS - IF NOT SAY ITS BEEN DELETED
+22 SET PIEC=0
+23 IF (SNUM<(INUM+1))&('$ORDER(^DIZ(DIE,"B",SNUM,PIEC)))
WRITE !!,"SUPPORT NUMBER, ",SNUM,", HAS ALREADY BEEN DELETED!",!
HANG 3
GOTO SUPPNUM
+24 +25 SET DA=SNUM
+26 ;DR - STUFF .01(SUPPORT NUMBER)
SET DR=".01///^S X=DA;.05:7"
+27 ;CALL FILEMAN TO ENTER/EDIT ^SUPPDB (DATABASE GLOBAL)
+28 LOCK ^DIZ(DIE,DA):0
IF '$TEST
WRITE !!,"RECORD HAS BEEN LOCKED, TRY AGAIN LATER!",!
HANG 3
GOTO SUPPNUM
+29 DO ^DIE
LOCK
+30 +31 WRITE !!!!
+32 READ !,"DO YOU WANT TO CONTINUE WITH ENTER/EDIT? Y// ",YN
+33 +34 ;STAY IN ENTRY SUB-ROUNTINE
IF (YN="Y")!(YN="")
GOTO ENTRY
+35 ;OTHERWISE RETURN TO MAINMENU
QUIT
+36
***** ERRORS & WARNINGS IN AZXZSUP *****
AZXZSUP+1 S - 2nd line of routine violates the SAC.
AZXZSUP+6 W - Null line (no commands or comment).
MAIN+4 W - Null line (no commands or comment).
MAIN+8 W - Null line (no commands or comment).
MAINMENU+3 W - Null line (no commands or comment).
MAINMENU+12 W - Blank(s) at end of line.
MAINMENU+16 W - Blank(s) at end of line.
MAINMENU+19 W - Null line (no commands or comment).
ENTRY+4 W - Null line (no commands or comment).
ENTRY+7 W - Null line (no commands or comment).
ENTRY+10 W - Null line (no commands or comment).
SUPPNUM+4 W - Null line (no commands or comment).
SUPPNUM+7 W - Null line (no commands or comment).
SUPPNUM+10 W - Null line (no commands or comment).
SUPPNUM+13 W - Null line (no commands or comment).
SUPPNUM+16 W - Null line (no commands or comment).
SUPPNUM+18 W - Blank(s) at end of line.
SUPPNUM+24 W - Null line (no commands or comment).
SUPPNUM+29 W - Blank(s) at end of line.
SUPPNUM+30 W - Null line (no commands or comment).
SUPPNUM+33 W - Null line (no commands or comment).
SUPPNUM+36 W - Null line (no commands or comment).