AZXRBUG7 ;BUGDRUG2 Report Input PROGRAM [ 06/29/93 9:42 AM ]
;Version 1
;09/04/92 JOHN H. LYNCH
;
;ALLOWS THE USER TO INPUT THE FACILITY AND THE
;DATE RANGES FOR THE BUGDRUG2 REPORTS, 'Cultured
;Organisms by Source' AND 'Antibiotic Sensitivity'.
;THE ROUTINES THAT CALL AZXRBUG7:
;AZXRBUG5, Sensitivity Report.
;AZXRBUG6, Organisms by Source Report.
;THE ROUTINES THAT AZXRBUG7 CALLS:
;^DIC, Fileman Lookup.
;^%DT, Fileman Date Conversion.
;Variable List
;DIC= Global root of file for Fileman Lookup.
;DIC(0)= Fileman Lookup parameters.
;DIC("A")= Fileman Lookup default prompt.
;OPTION= Sent from AZXRBUG5 or AZXRBUG6 (specifies report type).
;BACKUP= Flags whether user wants to back up one prompt.
;%DT= Fileman Date Conversion parameters.
;%DT("A")= Fileman Date Conversion default prompt.
;Variables which are sent to either, AZXRBUG5 or AZXRBUG6:
;FACBKUP= Flag returned to AZXRBUG5 or AZXRBUG6 with data on
; whether user wants to quit.
;FAC= Facility in external form.
;FCLTY= Internal Number of site from SITES file.
;FDATE= Fileman From Date is returned in FDATE.
;TDATE= Fileman To Date is return in TDATE.
MAIN ;AZXRBUG7 PROGRAM CONTROL
D INPUT
D KILL
Q
INPUT ;ASK USER FOR THE FACILITY TO USE FOR REPORT
;THEN CALL FDATE ROUTINE
;SET LOCAL VARIABLES
S DIC="^DIZ(1991010," ;GLOBAL ROOT OF SITES FILE
;USED FOR LOOKUP
S DIC(0)="AEQZ" ;DIC(0)= LOOKUP VALUES
; A= ASK USER FOR INPUT
; E= ECHO ANSWER
; Q= QUESTION ERRONEOUS INPUT
; Z= ZERO NODE RETURNED IN
; Y(0) AND EXTERNAL FORM
; IN Y(0,0)
S DIC("A")="Enter Facility: " ;DIC("A")= DEFAULT PROMPT FOR
; LOOKUP
W @IOF ;CLEAR SCREEN
I OPTION=2 W !!!,"BugDrug2 'Antibiotic Sensitivity Report'...",!!
I OPTION=3 W !!!,"BugDrug2 'Cultured Organisms by Source Report'...",!!
FACILITY ;CALL FILEMAN LOOKUP FOR FACILITY
D ^DIC
I (X="^")!(X="") S FACBKUP="Y" Q ;X= USER INPUT VALUE FROM ^DIC
;FACBKUP= RETURNED VARIABLE
; WHICH TELLS WHETHER
; USER WANTS TO BACKUP
; A PROMPT
S FACBKUP="N" ;--USER DOESN'T WANT TO BACKOR
S FAC=Y(0,0) ;FAC= FACILITY IN EXTERNAL FROM
S FCLTY=$P(Y,U,1) ;FCLTY= INTERNAL NUMBER OF SITE
D FDATE
I BACKUP="Y" G FACILITY
Q
FDATE ;ASK USER FOR THE FROM DATE TO USE FOR REPORT
;SET LOCAL VARIABLES
S BACKUP="N" ;BACKUP= VARIABLE USED FOR
; CHECKING WHETHER USER
; WANTS TO BACK UP "^"
S %DT="AEX" ;VALIDATES DATE INPUT AND
;CONVERTS IT FOR STORAGE
; A= ASK FOR DATE INPUT
; E= ECHO ANSWER
; X= EXACT DATE REQUIRED
S %DT("A")="From Date: " ;%DT("A")= DEFAULT PROMPT;FDATE
D ^%DT ;CALL FILEMAN DATE CONVERSION
I (X="^")!(X="") S BACKUP="Y" Q ;USER WANTS TO BACK UP
I X?1.3"?" G FDATE ;INQUIRY TO HELP; GOTO FDATE
I Y=-1 W !!,*7,"Invalid Date: Press a '?' for help." G FDATE
;INVALID ENTRY; GOTO FDATE
S FDATE=Y ;FDATE= FILEMAN DATE RETURNED
; IN Y
D TDATE ;SET TO DATE
I BACKUP="Y" G FDATE ;USER WANTS TO BACK UP "^"
Q
TDATE ;ASK USER FOR THE TO DATE TO USE FOR REPORT
;SET LOCAL VARIABLE
S BACKUP="N" ;BACKUP= VARIABLE USED FOR
; CHECKING WHETHER USER
; WANTS TO BACK UP "^"
S %DT="AEX" ;VALIDATES DATE INPUT AND
;CONVERTS IT FOR STORAGE
; A= ASK FOR DATE INPUT
; E= ECHO ANSWER
; X= EXACT DATE REQUIRED
S %DT("A")="To Date: " ;%DT("A")= DEFAULT PROMPT;TDATE
D ^%DT ;CALL FILEMAN
I (X="^")!(X="") S BACKUP="Y" Q ;USER WANTS TO BACK UP
I X?1.3"?" G TDATE ;INQUIRY TO HELP; GOTO TDATE
I Y=-1 W !!,*7,"Invalid Date: Press a '?' for help." G TDATE
;INVALID ENTRY; GOTO TDATE
S TDATE=Y ;TDATE= FILEMAN DATE RETURNED
; IN Y
I TDATE<FDATE W !!,"'To Date' must be greater than or equal to 'From Date'",! G TDATE
Q
KILL ;KILL LOCAL VARIABLES AND EXIT ROUTINE AZXRBUG7
K DIC,BACKUP,%DT
Q
AZXRBUG7 ;BUGDRUG2 Report Input PROGRAM [ 06/29/93 9:42 AM ]
+1 ;Version 1
+2 ;09/04/92 JOHN H. LYNCH
+3 ;
+4 ;ALLOWS THE USER TO INPUT THE FACILITY AND THE
+5 ;DATE RANGES FOR THE BUGDRUG2 REPORTS, 'Cultured
+6 ;Organisms by Source' AND 'Antibiotic Sensitivity'.
+7 +8 ;THE ROUTINES THAT CALL AZXRBUG7:
+9 ;AZXRBUG5, Sensitivity Report.
+10 ;AZXRBUG6, Organisms by Source Report.
+11 +12 ;THE ROUTINES THAT AZXRBUG7 CALLS:
+13 ;^DIC, Fileman Lookup.
+14 ;^%DT, Fileman Date Conversion.
+15 +16 ;Variable List
+17 ;DIC= Global root of file for Fileman Lookup.
+18 ;DIC(0)= Fileman Lookup parameters.
+19 ;DIC("A")= Fileman Lookup default prompt.
+20 ;OPTION= Sent from AZXRBUG5 or AZXRBUG6 (specifies report type).
+21 ;BACKUP= Flags whether user wants to back up one prompt.
+22 ;%DT= Fileman Date Conversion parameters.
+23 ;%DT("A")= Fileman Date Conversion default prompt.
+24 +25 ;Variables which are sent to either, AZXRBUG5 or AZXRBUG6:
+26 ;FACBKUP= Flag returned to AZXRBUG5 or AZXRBUG6 with data on
+27 ; whether user wants to quit.
+28 ;FAC= Facility in external form.
+29 ;FCLTY= Internal Number of site from SITES file.
+30 ;FDATE= Fileman From Date is returned in FDATE.
+31 ;TDATE= Fileman To Date is return in TDATE.
+32 +33 MAIN ;AZXRBUG7 PROGRAM CONTROL
+1 +2 DO INPUT
+3 DO KILL
+4 QUIT
+5 INPUT ;ASK USER FOR THE FACILITY TO USE FOR REPORT
+1 ;THEN CALL FDATE ROUTINE
+2 ;SET LOCAL VARIABLES
+3 ;GLOBAL ROOT OF SITES FILE
SET DIC="^DIZ(1991010,"
+4 ;USED FOR LOOKUP
+5 +6 ;DIC(0)= LOOKUP VALUES
SET DIC(0)="AEQZ"
+7 ; A= ASK USER FOR INPUT
+8 ; E= ECHO ANSWER
+9 ; Q= QUESTION ERRONEOUS INPUT
+10 ; Z= ZERO NODE RETURNED IN
+11 ; Y(0) AND EXTERNAL FORM
+12 ; IN Y(0,0)
+13 +14 ;DIC("A")= DEFAULT PROMPT FOR
SET DIC("A")="Enter Facility: "
+15 ; LOOKUP
+16 +17 ;CLEAR SCREEN
WRITE @IOF
+18 +19 IF OPTION=2
WRITE !!!,"BugDrug2 'Antibiotic Sensitivity Report'...",!!
+20 IF OPTION=3
WRITE !!!,"BugDrug2 'Cultured Organisms by Source Report'...",!!
+21 FACILITY ;CALL FILEMAN LOOKUP FOR FACILITY
+1 DO ^DIC
+2 +3 ;X= USER INPUT VALUE FROM ^DIC
IF (X="^")!(X="")
SET FACBKUP="Y"
QUIT
+4 ;FACBKUP= RETURNED VARIABLE
+5 ; WHICH TELLS WHETHER
+6 ; USER WANTS TO BACKUP
+7 ; A PROMPT
+8 ;--USER DOESN'T WANT TO BACKOR
SET FACBKUP="N"
+9 +10 ;FAC= FACILITY IN EXTERNAL FROM
SET FAC=Y(0,0)
+11 +12 ;FCLTY= INTERNAL NUMBER OF SITE
SET FCLTY=$PIECE(Y,U,1)
+13 +14 DO FDATE
+15 +16 IF BACKUP="Y"
GOTO FACILITY
+17 QUIT
+18 FDATE ;ASK USER FOR THE FROM DATE TO USE FOR REPORT
+1 ;SET LOCAL VARIABLES
+2 ;BACKUP= VARIABLE USED FOR
SET BACKUP="N"
+3 ; CHECKING WHETHER USER
+4 ; WANTS TO BACK UP "^"
+5 +6 ;VALIDATES DATE INPUT AND
SET %DT="AEX"
+7 ;CONVERTS IT FOR STORAGE
+8 ; A= ASK FOR DATE INPUT
+9 ; E= ECHO ANSWER
+10 ; X= EXACT DATE REQUIRED
+11 +12 ;%DT("A")= DEFAULT PROMPT;FDATE
SET %DT("A")="From Date: "
+13 +14 ;CALL FILEMAN DATE CONVERSION
DO ^%DT
+15 +16 ;USER WANTS TO BACK UP
IF (X="^")!(X="")
SET BACKUP="Y"
QUIT
+17 ;INQUIRY TO HELP; GOTO FDATE
IF X?1.3"?"
GOTO FDATE
+18 IF Y=-1
WRITE !!,*7,"Invalid Date: Press a '?' for help."
GOTO FDATE
+19 ;INVALID ENTRY; GOTO FDATE
+20 +21 ;FDATE= FILEMAN DATE RETURNED
SET FDATE=Y
+22 ; IN Y
+23 +24 ;SET TO DATE
DO TDATE
+25 ;USER WANTS TO BACK UP "^"
IF BACKUP="Y"
GOTO FDATE
+26 QUIT
+27 TDATE ;ASK USER FOR THE TO DATE TO USE FOR REPORT
+1 ;SET LOCAL VARIABLE
+2 ;BACKUP= VARIABLE USED FOR
SET BACKUP="N"
+3 ; CHECKING WHETHER USER
+4 ; WANTS TO BACK UP "^"
+5 +6 ;VALIDATES DATE INPUT AND
SET %DT="AEX"
+7 ;CONVERTS IT FOR STORAGE
+8 ; A= ASK FOR DATE INPUT
+9 ; E= ECHO ANSWER
+10 ; X= EXACT DATE REQUIRED
+11 +12 ;%DT("A")= DEFAULT PROMPT;TDATE
SET %DT("A")="To Date: "
+13 +14 ;CALL FILEMAN
DO ^%DT
+15 +16 ;USER WANTS TO BACK UP
IF (X="^")!(X="")
SET BACKUP="Y"
QUIT
+17 ;INQUIRY TO HELP; GOTO TDATE
IF X?1.3"?"
GOTO TDATE
+18 IF Y=-1
WRITE !!,*7,"Invalid Date: Press a '?' for help."
GOTO TDATE
+19 ;INVALID ENTRY; GOTO TDATE
+20 +21 ;TDATE= FILEMAN DATE RETURNED
SET TDATE=Y
+22 ; IN Y
+23 IF TDATE<FDATE
WRITE !!,"'To Date' must be greater than or equal to 'From Date'",!
GOTO TDATE
+24 QUIT
+25 KILL ;KILL LOCAL VARIABLES AND EXIT ROUTINE AZXRBUG7
+1 KILL DIC,BACKUP,%DT
+2 QUIT