ECTSBED ;B'ham ISC/PTD-Bedsection Workload Report ;01/29/91 08:00
V ;;1.05;INTERIM MANAGEMENT SUPPORT;;
I '$D(^DGAM(334)) W *7,!!?29,"OPTION IS UNAVAILABLE!",!,"The 'AMIS 334-341' File - #42.6 is not loaded on your system.",!! S XQUIT="" Q
I '$O(^DGAM(334,0)) W *7,!!,"'AMIS 334-341' File - #42.6 has not been populated on your system.",!! S XQUIT="" Q
;CHOOSE ALL SEGMENTS OR A SINGLE SEGMENT
CHS W !!,"You may choose to print the report for:",!!,"1. A selected AMIS segment.",!?10,"OR",!,"2. All AMIS segments.",!!,"Select a number (1 or 2): "
R CHS:DTIME G:'$T!("^"[CHS) EXIT I CHS'?1N!(CHS<1)!(CHS>2) W !!,*7,"You MUST answer ""1"" or ""2""." G CHS
;IF CHS=2, THEN SORT BY DATE FOR ALL SEGMENTS; ELSE SORT BY DATE FOR A SELECTED SEGMENT
S QFLG=0 D SGMT G:QFLG EXIT
DIP S DIC="^DGAM(334,",L=0,FLDS="10,.01,10,.01;L25,18,(#5+#6+#7+#8);R6;""DISCHARGES"",(#12+#21);""PATIENT DAYS OF CARE"""
S BY=$S(CHS=2:"#+.01,10,.01",1:".01,10,.01")
S DHD="BEDSECTION WORKLOAD REPORT" D EN1^DIP
EXIT K ANS,B,BY,CHS,DHD,DIC,ECT1,FLDS,FR,J,L,QFLG,SGMT,TO,X,Y
Q
;
SGMT ;SET FR,TO VARIABLES
I CHS=2 S (FR,TO)="?" Q
PICK W !!,"Choose the SEGMENT to SORT BY:",!,"1. PSYCHIARTY",!,"2. INTERMEDIATE",!,"3. MEDICINE",!,"4. NEUROLOGY",!,"5. REHAB MEDICINE",!,"6. BLIND REHAB",!,"7. SPINAL CORD INJURY",!,"8. SURGERY",!!,"Select a number (1 - 8): "
R ANS:DTIME S:'$T!("^"[ANS) QFLG=1 Q:QFLG I ANS'?1N!(ANS<1)!(ANS>8) W !!,*7,"You MUST answer with a number from 1 to 8." G PICK
S SGMT=$S(ANS=8:341,ANS=7:340,ANS=6:339,ANS=5:338,ANS=4:337,ANS=3:336,ANS=2:335,1:334)
S (FR,TO)="?,"_SGMT
Q
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HECTSBED 1613 printed Dec 13, 2024@02:02:52 Page 2
ECTSBED ;B'ham ISC/PTD-Bedsection Workload Report ;01/29/91 08:00
V ;;1.05;INTERIM MANAGEMENT SUPPORT;;
+1 IF '$DATA(^DGAM(334))
WRITE *7,!!?29,"OPTION IS UNAVAILABLE!",!,"The 'AMIS 334-341' File - #42.6 is not loaded on your system.",!!
SET XQUIT=""
QUIT
+2 IF '$ORDER(^DGAM(334,0))
WRITE *7,!!,"'AMIS 334-341' File - #42.6 has not been populated on your system.",!!
SET XQUIT=""
QUIT
+3 ;CHOOSE ALL SEGMENTS OR A SINGLE SEGMENT
CHS WRITE !!,"You may choose to print the report for:",!!,"1. A selected AMIS segment.",!?10,"OR",!,"2. All AMIS segments.",!!,"Select a number (1 or 2): "
+1 READ CHS:DTIME
if '$TEST!("^"[CHS)
GOTO EXIT
IF CHS'?1N!(CHS<1)!(CHS>2)
WRITE !!,*7,"You MUST answer ""1"" or ""2""."
GOTO CHS
+2 ;IF CHS=2, THEN SORT BY DATE FOR ALL SEGMENTS; ELSE SORT BY DATE FOR A SELECTED SEGMENT
+3 SET QFLG=0
DO SGMT
if QFLG
GOTO EXIT
DIP SET DIC="^DGAM(334,"
SET L=0
SET FLDS="10,.01,10,.01;L25,18,(#5+#6+#7+#8);R6;""DISCHARGES"",(#12+#21);""PATIENT DAYS OF CARE"""
+1 SET BY=$SELECT(CHS=2:"#+.01,10,.01",1:".01,10,.01")
+2 SET DHD="BEDSECTION WORKLOAD REPORT"
DO EN1^DIP
EXIT KILL ANS,B,BY,CHS,DHD,DIC,ECT1,FLDS,FR,J,L,QFLG,SGMT,TO,X,Y
+1 QUIT
+2 ;
SGMT ;SET FR,TO VARIABLES
+1 IF CHS=2
SET (FR,TO)="?"
QUIT
PICK WRITE !!,"Choose the SEGMENT to SORT BY:",!,"1. PSYCHIARTY",!,"2. INTERMEDIATE",!,"3. MEDICINE",!,"4. NEUROLOGY",!,"5. REHAB MEDICINE",!,"6. BLIND REHAB",!,"7. SPINAL CORD INJURY",!,"8. SURGERY",!!,"Select a number (1 - 8): "
+1 READ ANS:DTIME
if '$TEST!("^"[ANS)
SET QFLG=1
if QFLG
QUIT
IF ANS'?1N!(ANS<1)!(ANS>8)
WRITE !!,*7,"You MUST answer with a number from 1 to 8."
GOTO PICK
+2 SET SGMT=$SELECT(ANS=8:341,ANS=7:340,ANS=6:339,ANS=5:338,ANS=4:337,ANS=3:336,ANS=2:335,1:334)
+3 SET (FR,TO)="?,"_SGMT
+4 QUIT
+5 ;