source: WorldVistAEHR/trunk/r/SCHEDULING-SD-SC/SDAMOSP.m@ 1579

Last change on this file since 1579 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.1 KB
Line 
1SDAMOSP ;ALB/CAW - Print for Appointment Statistics;4/15/92
2 ;;5.3;Scheduling;**22**;Aug 13, 1993
3 ;
4HDR ;Report Header
5 ;
6 I $E(IOST,1,2)="C-" D PAUSE^VALM1 I 'Y S SDSTOP=1 Q
7HDR1 W @IOF,$S('SDFLG:"Division: "_$P($G(^DG(40.8,SDDV,0)),U),1:"MEDICAL CENTER")
8 W ?41,"Date Range: ",$$FDATE^VALM1(SDBEG)_" to "_$$FDATE^VALM1(SDEND)
9 D NOW^%DTC W ?95,"Run Date: ",$E($$FDTTM^VALM1(%),1,14),?125,"Page: ",SDPAGE S SDPAGE=SDPAGE+1
10 W !,?1,$S('SDFLG:"Clinic",1:"Division"),?34,"Checked-In",?48,"Checked-Out",?63,"No Action Taken",?83,"___No-show___",?99,"__Cancelled__",?114,"Inpatient",?127,"Total"
11 W !,?83,"Tot",?89,"CI",?94,"RB",?99,"Tot",?105,"CI",?110,"RB",!,SDASH
12 Q
13 ;
14BLD ;Build output from ^TMP global
15 ;
16 S (SDSTOP,SDTOT,SDFLG)=0,SDDV="" F S SDDV=$O(^TMP("SDAMS",$J,SDDV)) Q:SDDV=""!(SDSTOP) D:SDSEL=5 HDR D
17 .S SDCL="" F S SDCL=$O(^TMP("SDAMS",$J,SDDV,SDCL)) Q:SDCL=""!(SDSTOP) D S SDNXT=$O(^TMP("SDAMS",$J,SDDV,SDCL)) I SDNXT'="" W:SDSEL=4 !,SDASH
18 ..S SDCLI="" F S SDCLI=$O(^TMP("SDAMS",$J,SDDV,SDCL,SDCLI)) Q:'SDCLI!(SDSTOP) D
19 ...S SDAT="" F S SDAT=$O(^TMP("SDAMS",$J,SDDV,SDCL,SDCLI,SDAT)) Q:'SDAT!(SDSTOP) S SDCNT(SDAT)=^(SDAT)
20 ...W:SDSEL=5 !,SDCL F SDI=1:1:11 S SDTOT=$G(SDTOT)+$G(SDCNT(SDI))
21 ...D:SDSEL=5 CNT
22 ...I SDSEL=5 W ?124,$J(SDTOT,8) K SDTOT,SDCNT D CHK Q:SDSTOP
23 .Q:SDSTOP I SDSEL=5 W !,SDTDASH,!,"TOTAL" D TOTAL W ?124,$J(SDTOT,8) K SDTOT,SDCNT D CHK Q:SDSTOP
24 .I SDSEL=5 W !! D LEGEND
25BLDQ I SDSTOP Q
26 ;
27MCTOT S SDFLG=1,SDDV="" D HDR F S SDDV=$O(^TMP("SDAMS",$J,SDDV)) Q:SDDV="" D Q:SDSTOP
28 .W !,$P($G(^DG(40.8,SDDV,0)),U)
29 .K SDTOT,SDCNT D TOTAL
30 .W ?124,$J(SDTOT,8)
31 .D CHK Q:SDSTOP
32 .S SDNXT=$O(^TMP("SDAMS",$J,SDDV)) W:SDNXT'="" !,SDASH
33 .K SDTOT,SDCNT
34 W !,SDTDASH,!,"TOTAL" F SDI=1:1:11 S SDCNT(SDI)=+$G(SDAT("SDAMS",$J,SDI)),SDTOT=$G(SDTOT)+$G(SDCNT(SDI))
35 D CNT
36 W ?124,$J(SDTOT,8) K SDTOT,SDCNT D CHK I SDSTOP G MCTOTQ
37 W !! D LEGEND
38MCTOTQ Q
39CNT ;Place no-show/no-show auto rebook & cancel/cancel auto-rebook together
40 S SDCNT(4)=+$G(SDCNT(4))+(+$G(SDCNT(6))),SDCNT(13)=+$G(SDCI(+SDCL,4))+(+$G(SDCI(+SDCL,6)))
41 S SDCNT(5)=+$G(SDCNT(5))+(+$G(SDCNT(7))),SDCNT(14)=+$G(SDCI(+SDCL,5))+(+$G(SDCI(+SDCL,7)))
42 F SDI=1,2,3,4,13,6,5,14,7,8 D
43 .W ?$$COL(SDI),$J($S($D(SDCNT(SDI)):SDCNT(SDI),1:0),$$LEN(SDI))
44 Q
45 ;
46CHK ;Check to pause on screen
47 I $E(IOST,1,2)="C-",($Y+6)>IOSL D PAUSE^VALM1 S SDY=Y D:SDY HDR1 I 'SDY S SDSTOP=1 Q
48 I ($Y+6)>IOSL D HDR1
49 Q
50TOTAL ;Totals
51 F SDI=1:1:11 S SDCNT(SDI)=+$G(SDCL("SDAMS",$J,SDDV,SDI)),SDTOT=$G(SDTOT)+$G(SDCNT(SDI))
52 D CNT
53 K SDCNT
54 Q
55 ;
56LEGEND ;Legend on bottom of output
57 ;
58 W !,?5,"o CI=Checked In ; RB=Rebooked"
59 W !,?5,"o 'Cancelled' appointments only reflect appointments cancelled using 'Cancel Clinic Availability'."
60 W !,?5,"o 'Checked-In' does not include no-shows or cancelled appointments that have been checked in."
61 Q
62 ;
63COL(SDI) ;Column placement of appt. status
64 ;
65 ;input - SDI (appt. type)
66 ;output - column placement
67 Q $S(SDI=1:34,SDI=2:48,SDI=3:63,SDI=4:81,SDI=5:97,SDI=6:92,SDI=7:108,SDI=8:114,SDI=13:87,SDI=14:103)
68 ;
69LEN(SDI) ;Length of column
70 ;
71 ;input - SDI (appt. type)
72 ;output - length of column
73 Q $S(SDI=1:10,SDI=2:11,SDI=3:15,SDI=4:5,SDI=6:4,SDI=5:5,SDI=7:4,SDI=8:9,SDI=13:4,SDI=14:4)
74 ;
Note: See TracBrowser for help on using the repository browser.