1 | SDNOS ;ALB/LDB - NO SHOW REPORT ; 18 May 99 8:43 AM
|
---|
2 | ;;5.3;Scheduling;**22,28,32,79,194,410**;Aug 13, 1993
|
---|
3 | D END,LO^DGUTL
|
---|
4 | S (SDCL,X)="" S SDDIV=$$PRIM^VASITE() S SDIO=IO(0),(SDA,SDB1,SDC,SDV1,SDEND,SDSL,SDT,SDTIM)=0
|
---|
5 | DIV I $D(^DG(43,1,"GL")),$P(^("GL"),"^",2) S DIC("A")="NO SHOW REPORT FOR WHICH DIVISION: " D ASK^SDDIV S SDV1=1,SDDIV=$S($D(DIV):DIV,1:SDDIV) D MDIV Q:'$D(Y)
|
---|
6 | SEL F SDSL=1:1 D READ D:(X="^")!SDTIM END Q:'$D(X) Q:((X="")&(SDSL>1)) Q:SDA D Q:X=""&(SDSL=1)
|
---|
7 | .W:(Y'>0&'SDB1&'SDT&'SDC) !,"No such clinic"
|
---|
8 | .W:SDV1&'SDB1&SDDIV&(Y'>0)&'SDT&'SDC " associated with this division."
|
---|
9 | .S:Y'>0 SDSL=SDSL-1 S (SDB1,SDC,SDT)=0
|
---|
10 | .Q
|
---|
11 | Q:'$D(X) S:X=""&(SDSL=1) SDCL="A"
|
---|
12 | I SDTIM=1 D END Q
|
---|
13 | I 'SDA,(X="^")!(SDCL(1)']"")&(Y=-1) D END Q
|
---|
14 | FMT ;Select Format
|
---|
15 | S DIR(0)="S^1:No Shows ONLY;2:Both No Shows & No Action Taken"
|
---|
16 | S DIR("?")="Select format for printed report"
|
---|
17 | S DIR("B")="No Shows ONLY"
|
---|
18 | D ^DIR K DIR S SDFMT=Y
|
---|
19 | DATE W !!,"You may enter only a beginning date if you would like",!,"to see a report of No-Shows for only one date."
|
---|
20 | S SDT00="AEP",%DT(0)="-NOW" D DATE^SDUTL I ('$D(SDBD))&((X="^")!(X="")) D END Q
|
---|
21 | I '$D(SDED)&(X="^") D END Q
|
---|
22 | N DIR,SDABB S DIR(0)="Y",DIR("A")="Print report totals only",DIR("B")="YES"
|
---|
23 | S DIR("?")="Answer 'no' to obtain a detailed report, 'yes' to print just clinic totals"
|
---|
24 | W ! D ^DIR G:$D(DTOUT)!$D(DUOUT) END S SDABB=Y
|
---|
25 | ZIS W !! S DGPGM="^SDNOS0",DGVAR="SDCL#^SDDIV"_$S($D(SDBD):"^SDBD",1:"")_$S($D(SDED):"^SDED",1:"")_"^SDIO^SDABB^SDFMT"
|
---|
26 | D ZIS^DGUTQ G:POP END U IO D ^SDNOS0
|
---|
27 | D END,CLOSE^DGUTQ Q
|
---|
28 | ;
|
---|
29 | READ ;Select clinics
|
---|
30 | W !,"Select Clinic(s):"_$S(SDSL<2:" ALL// ",1:" ") R X:DTIME S:'$T SDTIM=1 Q:'$T!(X="^")!('$D(SDCL(2))&(SDSL>1)&(X="")) I X["?" D HELP
|
---|
31 | VALID S X=$$UP^XLFSTR(X) I ((X="")&(SDSL<2))!(X="ALL")&(SDSL<2) S SDCL(1)="ALL",SDA=1 Q
|
---|
32 | I X=""&(SDSL>1) Q
|
---|
33 | S SDM="$S(SDDIV'=""A""&$P(^(0),""^"",15):$P(^(0),""^"",15)=SDDIV,1:$P(^(0),""^"",15)="""")"
|
---|
34 | S DIC=44,DIC(0)="EQ",DIC("S")="I $P(^(0),""^"",3)=""C"",'$G(^(""OOS""))"
|
---|
35 | S DIC("S")=$S(SDDIV'="A"&SDV1:DIC("S")_","_SDM,1:DIC("S"))
|
---|
36 | I X?1"*".E S SDT=X,X=$E(X,2,$L(X)) D ^DIC Q:Y'>0 D INAC Q:Y'>0 S SDCL(SDSL)=+Y_$E(SDT,1)_$E(SDT,$F(SDT,"*"),$L(SDT)) Q
|
---|
37 | D ^DIC Q:Y'>0
|
---|
38 | S SDB1=0 I $D(SDCL)#10 F SDSB=0:0 S SDSB=$O(SDCL(SDSB)) Q:SDSB'>0 I SDCL(SDSB)=+Y W !,*7,"This clinic has all ready been selected",! S Y=-1,SDB1=1 Q
|
---|
39 | I 'SDB1 D INAC Q:Y'>0 S SDCL(SDSL)=+Y Q
|
---|
40 | Q
|
---|
41 | ;
|
---|
42 | HELP W !!,"Enter the clinic name here. Press return when you are finished choosing clinics.",!,"You may ask for a range of clinics by preceding the clinic or"
|
---|
43 | W !,"letter(s) that begin the clinic name with an asterisk. For example,"
|
---|
44 | W !,"if you would like to see all clinics that begin with MED, you could enter ",!,"*MED or *CT for all clinics that begin with CT."
|
---|
45 | W !,"You will then be asked to choose which actual clinic will begin the range.",!,"When you have chosen one, all clinics that contain the initial response for "
|
---|
46 | W !,"range and follow your choice in alphabetic order will be included in the report.",!
|
---|
47 | Q
|
---|
48 | ;
|
---|
49 | INAC ;Determine if clinic is inactive
|
---|
50 | S SDC=+Y,X="T" D ^%DT S DT=Y
|
---|
51 | I $D(^SC(SDC,"I")),$P(^("I"),U),$P(^("I"),U)'>DT W *7,!,"Clinic ",$S('$P(^("I"),U,2):"is",1:"was")," inactive ",$S('$P(^("I"),U,2):"as of ",1:"from ") S Y=$P(^("I"),U) D D^DIQ W Y
|
---|
52 | I I $P(^SC(SDC,"I"),U,2) S Y=$P(^("I"),U,2) D D^DIQ W " to ",Y,! D ASK Q
|
---|
53 | I $D(^SC(SDC,"I")),$P(^("I"),U),$P(^("I"),U)'>DT,'$P(^("I"),U,2) S Y=+SDC W ! D ASK Q
|
---|
54 | S Y=+SDC Q
|
---|
55 | ASK S %=2 S Y=+SDC W !,"Do you wish to include this clinic in the report" D YN^DICN I %=1 W ! S Y=+SDC Q
|
---|
56 | I %=-1!(%=2) S Y=-1 W ! Q
|
---|
57 | I '% W !,"Enter 'Yes' to include clinic in this report or 'No' to exclude from the report." G ASK
|
---|
58 | ;
|
---|
59 | END K %DT,ALL,BEGDATE,C,C1,C2,C3,C4,C5,C6,DGPGM,DGTCH,DGVAR,DIC,DIV
|
---|
60 | K ENDDATE,P1,POP,Q,SD,SD1,SD10,SD12,SD14,SD2,SDA,SDAPP,SDB1,SDBD
|
---|
61 | K SDBEG,SDBEG1,SDBG,SDC,SDCHK,SDCL,SDCL1,SDCT,SDCXX,SDDIV,SDV1
|
---|
62 | K SDDIV2,SDDIVO,SDED,SDEF,SDEN,SDEND,SDHD,SDIN,SDI1,SDABB,SDT00
|
---|
63 | K %I,%Y,%T,SDIO,SDIX,SDLAB,SDM,SDNM,SDNM1,SDNMS,SDNO,SDOK,SDOW
|
---|
64 | K SDPAT,SDPR,SDPR1,SDPT,SDR,SDR1,SDRB,SDREST,SDSL,SDSUB,SDSB
|
---|
65 | K SDT1,SDT2,SDT3,SDT4,SDT5,SDT6,SDT,SDTIM,SDTOT,SDTOT1,SDX,SDXX
|
---|
66 | K SDY,SDZ,SDZ1,SDZZ3,X,X1,Y,Y1,Y2,Y3,%,^UTILITY($J,"DGTC"),SDFMT
|
---|
67 | END1 K DTOUT,DUOUT,^UTILITY($J,"SDNO") Q
|
---|
68 | ;
|
---|
69 | MDIV I Y'>0 D END,CLOSE^DGUTQ Q
|
---|
70 | I $D(ALL),ALL S SDDIV="A" Q
|
---|
71 | Q
|
---|