1 | SDAMOCP ;IOFO BAY PINES/TEH - Print for Cancelled Statistics;4/15/92
|
---|
2 | ;;5.3;Scheduling;**487**;Aug 13, 1993
|
---|
3 | ;
|
---|
4 | HDR ;Report Header
|
---|
5 | ;
|
---|
6 | N SDSTOP,%
|
---|
7 | I SDPAGE>1,$E(IOST,1,2)="C-" D PAUSE^VALM1 I 'Y S SDSTOP=1 Q
|
---|
8 | HDR1 W @IOF
|
---|
9 | W !,?50,"Cancelled Clinic Report - Summary"
|
---|
10 | W !,?50,"Date Range: ",$$FDATE^VALM1(SDBEG)_" to "_$$FDATE^VALM1(SDEND)
|
---|
11 | D NOW^%DTC
|
---|
12 | W !,?54,"Run Date: ",$E($$FDTTM^VALM1(%),1,14)
|
---|
13 | W !,?62,"Page: ",SDPAGE S SDPAGE=SDPAGE+1
|
---|
14 | W !!,"Division"
|
---|
15 | W ?34,"Can'd by Clinic",?52,"Can'd by Clinic RB",?73,"Can'd by Patient",?92,"Can'd by Patient RB",?114,"Total"
|
---|
16 | W !,SDASH
|
---|
17 | Q
|
---|
18 | ;
|
---|
19 | BLD ;Build output from ^TMP global
|
---|
20 | ;
|
---|
21 | N SDCTYP,SDTOTS,SDTOTN,SDCI,SDCL,SDDV,SDDVNM,SDFLG,SDNXT,SDTAB
|
---|
22 | N SDTOTT,SDY
|
---|
23 | S (SDSTOP,SDTOT,SDTOTT,SDFLG)=0,SDDV="" F S SDDV=$O(^TMP("SDAMC",$J,SDDV)) Q:SDDV=""!(SDSTOP) D CHK D
|
---|
24 | .S SDDVNM=$P($G(^DG(40.8,SDDV,0)),U) W !,SDDVNM
|
---|
25 | .S SDCL="" F S SDCL=$O(^TMP("SDAMC",$J,SDDV,SDCL)) Q:SDCL="" D
|
---|
26 | ..K SDTOT,SDTOTS W !,?12,$P($G(^SC(SDCL,0)),U) S SDTOT=0,SDTOT(SDCL)=0 F SDTOTN=1:1:4 S SDTOTS(SDTOTN)=0
|
---|
27 | ..S SDCTYP="" F S SDCTYP=$O(^TMP("SDAMC",$J,SDDV,SDCL,SDCTYP)) Q:SDCTYP="" D
|
---|
28 | ...S SDTOT=$G(^TMP("SDAMC",$J,SDDV,SDCL,SDCTYP)),SDTOTT=SDTOTT+SDTOT,SDTOTS(SDCTYP)=SDTOT,SDTOT(SDCL)=SDTOT(SDCL)+SDTOT
|
---|
29 | ..F SDTOTN=1:1:4 S SDTAB=$S(SDTOTN=1:41,SDTOTN=2:58,SDTOTN=3:79,SDTOTN=4:98,1:0) W ?SDTAB,$J(SDTOTS(SDTOTN),3)
|
---|
30 | ..W ?116,$J(SDTOT(SDCL),3)
|
---|
31 | W !,?114,"-----",!,?90,"Total Cancellations:",?116,$J(SDTOTT,3)
|
---|
32 | W !!,"End of Report!"
|
---|
33 | BLDQ Q
|
---|
34 | ;
|
---|
35 | MCTOT ;
|
---|
36 | N SDAT
|
---|
37 | S SDFLG=1,SDDV="" D HDR F S SDDV=$O(^TMP("SDAMS",$J,SDDV)) Q:SDDV="" D Q:SDSTOP
|
---|
38 | .W !,$P($G(^DG(40.8,SDDV,0)),U)
|
---|
39 | .K SDTOT,SDCNT D TOTAL
|
---|
40 | .W ?124,$J(SDTOT,8)
|
---|
41 | .D CHK Q:SDSTOP
|
---|
42 | .S SDNXT=$O(^TMP("SDAMS",$J,SDDV)) W:SDNXT'="" !,SDASH
|
---|
43 | .K SDTOT,SDCNT
|
---|
44 | W !,SDTDASH,!,"TOTAL" F SDI=1:1:11 S SDCNT(SDI)=+$G(SDAT("SDAMS",$J,SDI)),SDTOT=$G(SDTOT)+$G(SDCNT(SDI))
|
---|
45 | D CNT
|
---|
46 | W ?124,$J(SDTOT,8) K SDTOT,SDCNT D CHK I SDSTOP G MCTOTQ
|
---|
47 | W !! D LEGEND
|
---|
48 | MCTOTQ Q
|
---|
49 | CNT ;Place no-show/no-show auto rebook & cancel/cancel auto-rebook together
|
---|
50 | S SDCNT(4)=+$G(SDCNT(4))+(+$G(SDCNT(6))),SDCNT(13)=+$G(SDCI(+SDCL,4))+(+$G(SDCI(+SDCL,6)))
|
---|
51 | S SDCNT(5)=+$G(SDCNT(5))+(+$G(SDCNT(7))),SDCNT(14)=+$G(SDCI(+SDCL,5))+(+$G(SDCI(+SDCL,7)))
|
---|
52 | F SDI=1,2,3,4,13,6,5,14,7,8 D
|
---|
53 | .W ?$$COL(SDI),$J($S($D(SDCNT(SDI)):SDCNT(SDI),1:0),$$LEN(SDI))
|
---|
54 | Q
|
---|
55 | ;
|
---|
56 | CHK ;Check to pause on screen
|
---|
57 | I $E(IOST,1,2)="C-",($Y+8)>IOSL D PAUSE^VALM1
|
---|
58 | S SDY=FMT D:SDY HDR1 I 'SDY S SDSTOP=1 Q
|
---|
59 | I ($Y+8)>IOSL D HDR1
|
---|
60 | Q
|
---|
61 | TOTAL ;Totals
|
---|
62 | F SDI=1:1:11 S SDCNT(SDI)=+$G(SDCL("SDAMS",$J,SDDV,SDI)),SDTOT=$G(SDTOT)+$G(SDCNT(SDI))
|
---|
63 | D CNT
|
---|
64 | K SDCNT
|
---|
65 | Q
|
---|
66 | ;
|
---|
67 | LEGEND ;Legend on bottom of output
|
---|
68 | ;
|
---|
69 | W !,?5,"o CI=Checked In ; RB=Rebooked"
|
---|
70 | W !,?5,"o 'Cancelled' appointments only reflect appointments cancelled using 'Cancel Clinic Availability'."
|
---|
71 | W !,?5,"o 'Checked-In' does not include no-shows or cancelled appointments that have been checked in."
|
---|
72 | Q
|
---|
73 | ;
|
---|
74 | COL(SDI) ;Column placement of appt. status
|
---|
75 | ;
|
---|
76 | ;input - SDI (appt. type)
|
---|
77 | ;output - column placement
|
---|
78 | 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)
|
---|
79 | ;
|
---|
80 | LEN(SDI) ;Length of column
|
---|
81 | ;
|
---|
82 | ;input - SDI (appt. type)
|
---|
83 | ;output - length of column
|
---|
84 | 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)
|
---|
85 | ;
|
---|