source: WorldVistAEHR/trunk/r/SCHEDULING-SD-SC/SDWLQOF.m@ 1096

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

initial load of WorldVistAEHR

File size: 4.6 KB
RevLine 
[613]1SDWLQOF ;;IOFO BAY PINES/TEH - OVERDUE APPOINTMENT
2 ;;5.3;scheduling;**263,414,425,448**;AUG 13 1993
3 ;
4 ;
5 ;******************************************************************
6 ; CHANGE LOG
7 ;
8 ; DATE PATCH DESCRIPTION
9 ; ---- ----- -----------
10 ;
11EN ;Header
12 N ZCODE,ZTDESC,ZTDTH,ZTIO,ZTQUEDED,ZTREQ,ZTRTN,ZTSAVE,ZTSK,SDWLSPT
13 D HD
14 S SDWLINST="",SDWLERR=0 K ^TMP("SDWLQOF",$J),DIC,DIR,DR,DIE
151 D INS G END:$D(DUOUT)
162 D CAT G 1:SDWLERR,END:$D(DUOUT)
173 D FORM G 2:SDWLERR,END:$D(DUOUT)
184 D DIS G EN:SDWLERR=1,END:SDWLERR=2
19 D QUE
20 Q
21INS ;Get Institution
22 S SDWLERR=0,SDWLPROM="Select Institution ALL // "
23IN W ! S DIC(0)="QEMA",DIC("A")=SDWLPROM,DIC=4,DIC("S")="I $D(^SDWL(409.32,""C"",+Y))!($D(^SDWL(409.31,""E"",+Y)))!($D(^SCTM(404.51,""AINST"",+Y)))" D ^DIC I Y<0,'SDWLERR Q:$D(DUOUT) S Y="ALL"
24 G IN2:Y<0 Q:$D(DUOUT)
25 I Y<0 S SDWLINST=$S(Y="ALL":"ALL",Y="":"ALL",Y="all":"ALL",Y="All":"ALL",Y["A":"ALL",Y["a":"ALL")
26 I Y="All"!(Y="")!(Y="all")!(Y="ALL") S SDWLINST="ALL",^TMP("SDWLQOF",$J,"INS")="ALL" G IN3
27 S SDWLPROM="Another Institution: ",SDWLERR=1
28 G IN:$D(SDWLIN(+Y)) S SDWLIN(+Y)=""
29 S SDWLINST=SDWLINST_Y_";",SDWLPROM="Another Institution: ",SDWLERR=1 G IN
30IN2 S ^TMP("SDWLQOF",$J,"INS")=SDWLINST
31IN3 Q
32CAT ;Report category selection
33 K DIR,DIE,DR,DIC
34 W !!," *** Report Category Selection ***" S SDWLERR=0
35 S SDWLERR=0,SDWLCAT="",DIR(0)="SO^1:Clinic;2:Select Service/Specialty",DIR("L",1)=" 1. Clinic",DIR("L")=" 2. Service/Specialty"
36 D ^DIR
37 I X="^" S SDWLERR=1 W *7 Q
38 I X="" S SDWLERR=1 W *7 Q
39 S X=$S(X["C":"C",X["c":"C",X["S":"S",X["s":"S",X=1:"C",X=2:"S",1:"")
40 I X="" W *7," Invalid Selection." G CAT
41 W !!,"Select Category for Report Output",!
42 S SDWLX=$S(X="C":"Clinic: ALL/ ",X="S":"Service/Specialty: ALL/ ")
43 S SDWLF=$S(X["C":409.32,X["S":409.31,X["c":409.32,X["s":409.31)
44 S SDWLFD=$S(X="C":8,1:7)
45 S SDWLCTX=X
46 K DIR,DIC,DR
47 S ^TMP("SDWLQOF",$J,"CT1")=SDWLCTX_"^"_SDWLF_"^"_SDWLFD,DIC("A")=SDWLX,SDWLE=0
48CT1 W ! S DIC(0)="QEMNZA",DIC=SDWLF D ^DIC I 'SDWLE,Y<1 S ^TMP("SDWLQOF",$J,"CT2")="ALL" G CT3
49 I Y<0,'$D(^TMP("SDWLQOF",$J,"CT1")) W !,"This Entry is Required." G CAT
50 G CT2:Y<0
51 S SDWLCAT=SDWLCAT_Y_";",DIC("A")="Another "_$P(SDWLX,":",1)_": ",SDWLE=1 G CT1
52CT2 G CT1:'$D(SDWLCAT) S ^TMP("SDWLQOF",$J,"CT2")=SDWLCAT
53CT3 Q
54FORM ;Report Format
55 S SDWLERR=0,DIR(0)="SO^1:D:Detailed;S:Summary",DIR("L",2)=" D Detailed"
56 S DIR("L")=" S Summary",DIR("L",1)="Select One of the Following: "
57 D ^DIR
58 I X="^" S DUOUT=1 Q
59 S SDWLFORM=$S(X["D":"D",X["d":"D",X["S":"S",X["s":"S",1:"")
60 I X="" W !,"Required!" G FORM
61 S ^TMP("SDWLQOF",$J,"FORM")=SDWLFORM
62 Q
63DIS ;Display Parameters
64 S SDWLERR=0 W !!,?80-$L("*** Selected Report Parameters ***")\2,"*** Selected Report Parameters ***",!
65 F SDWLI="INS","CT1","CT2","FORM" D
66 .S X="SDWL"_SDWLI,@X=$G(^TMP("SDWLQOF",$J,SDWLI))
67 F SDWLTAG="IS","CT","OP" D @SDWLTAG
68 Q
69IS I SDWLINS'["ALL" D
70 .K SDWLY F I=1:1 S SDWLY=$P($P(SDWLINS,";",I),U,2) Q:SDWLY="" S SDWLY(I)=SDWLY
71 .W !,?20,"Institution: "
72 .I $D(SDWLY) S I="" F S I=$O(SDWLY(I)) Q:I="" W:I>1 !,?33 W SDWLY(I)
73 .K SDWLY
74 I SDWLINS["ALL" W !,?20,"Institution: ALL "
75 Q
76CT I SDWLCT2'["ALL" D
77 .S SDWLF=$P(SDWLCT1,U,2)
78 .K SDWLY F I=1:1 S SDWLY=$P($P(SDWLCT2,";",I),U,2) Q:SDWLY="" S SDWLY(I)=SDWLY
79 .W !,?16,"Report Category: " W $S(SDWLCT1["C":"Clinic",1:"Service Specialty"),!,?36 I @X="ALL" W "All "
80 .I $D(SDWLY) S I="" F S I=$O(SDWLY(I)) Q:I="" W:I>1 !,?35 W $$EXTERNAL^DILFD(SDWLF,.01,,SDWLY(I))
81 I SDWLCT2["ALL" W !,?16,"Report Category: " W $S(SDWLCT1["C":"Clinic",1:"Service Specialty"),!,?36 W "ALL "
82 Q
83OP W !,?18,"Output Format: ",$S(SDWLFORM="D":" Detailed",1:" Summary")
84 Q
85 S %=1 W !!,"Are these Parameters Correct " D YN^DICN I %=2 S SDWLERR=1 W !," This Report will NOT be queued to print."
86 I SDWLERR S DIR(0)="E" D ^DIR I X["^" S SDWLERR=2
87 Q
88QUE ;Queue Report
89 N ZTQUEUED,POP
90 K %ZIS,IOP,IOC,ZTIO S %ZIS="MQ" D ^%ZIS G:POP QUE1
91 S ZTRTN=$S(SDWLFORM="D":"EN^SDWLROF",1:"EN^SDWLROS"),ZTDTH=$H,ZTDESC="WAIT LIST OVERDUE REPORT"
92 S SDWLTASK="" F S SDWLTASK=$O(^TMP("SDWLQOF",$J,SDWLTASK)) Q:SDWLTASK="" D
93 .S SDWLTK=$G(^TMP("SDWLQOF",$J,SDWLTASK))
94 .S ZTSAVE(SDWLTASK)=SDWLTK
95 I $D(IO("Q")) K IO("Q") D ^%ZTLOAD W !,"REQUEST QUEUED" G END
96QUE1 S:$E(IOST,1,2)="C-" SDWLSPT=1 I $D(ZTRTN) U IO D @ZTRTN K SDWLSPT
97 ;
98END ;
99 K SDWLTASK,SDWLY,SDWLED,WDWLBD,SDWLOPEN,SDWLDATE,SDWLFORM,SDWLPRI,I
100 K DIR,DIC,DR,DIE
101 D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@"
102 Q
103HD W:$D(IOF) @IOF W !,?80-$L("Overdue Appointment Wait List Report")\2,"Overdue Appointment Wait List Report"
104 Q
Note: See TracBrowser for help on using the repository browser.