Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: SDWLQSR

SDWLQSR.m

Go to the documentation of this file.
  1. SDWLQSR ;BPOI/TEH - WAIT LIST STAT REPORT;06/12/02
  1. ;;5.3;scheduling;**263,425,448,524**;08/13/93;Build 29
  1. ;
  1. ;
  1. ;
  1. ;
  1. ;
  1. EN N ZCODE,ZTDESC,ZTDTH,ZTIO,ZTQUEDED,ZTREQ,ZTRTN,ZTSAVE,ZTSK,POP
  1. K ^TMP("SDWLQSR",$J)
  1. D HD
  1. 1 D INS G END:$D(DUOUT)
  1. 2 D DATE G END:$D(DUOUT)
  1. 3 D EXCL G END:$D(DUOUT)
  1. D QUE G END:$D(DUOUT)
  1. Q
  1. INS ;Get Institution
  1. S SDWLERR=0,SDWLPROM="Select Institution ALL // ",SDWLINST=""
  1. IN 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"
  1. G IN2:Y<0 Q:$D(DUOUT)
  1. I Y<0 S SDWLINST=$S(Y="ALL":"ALL",Y="":"ALL",Y="all":"ALL",Y="All":"ALL",Y["A":"ALL",Y["a":"ALL")
  1. I Y="All"!(Y="")!(Y="all")!(Y="ALL") S SDWLINST="ALL",^TMP("SDWLQSR",$J,"INS")="ALL" G IN3
  1. S SDWLINST=SDWLINST_Y_";",SDWLPROM="Another Institution: ",SDWLERR=1 G IN
  1. IN2 S ^TMP("SDWLQSR",$J,"INS")=SDWLINST
  1. IN3 Q
  1. DATE ;Date range selection
  1. K X,Y,%DT
  1. S SDWLERR=0 W ! S %DT="AE",%DT("A")="Start Date: " D ^%DT
  1. I X["^" S DUOUT=1 Q
  1. I Y<0 S DUOUT=1 Q
  1. S SDWLBDT=Y
  1. Q:$D(DUOUT)
  1. S %DT("A")="End Date: " D ^%DT G DATE:Y<1 S SDWLEDT=Y K %DT(0),%DT("A")
  1. G DATE:$D(DUOUT)
  1. I SDWLEDT<SDWLBDT W !,"Beginning Date must be greater than Ending Date." G DATE
  1. S ^TMP("SDWLQSR",$J,"DATE")=SDWLBDT_"^"_SDWLEDT K DIR,DIC,DIE,%DT Q
  1. Q
  1. EXCL ;EXCLUDE # REMAINING =0 - PATCH SD*5.3*524
  1. S SDWLEXCL=0,^TMP("SDWLQSR",$J,"EXCL")=0
  1. S DIR("A",1)="Do you wish to exclude any Teams, Specialities or Specific"
  1. S DIR("A")="Clinics where ALL values are zero"
  1. S DIR("B")="YES",DIR(0)="Y^A0" D ^DIR
  1. I X["^" S DUOUT=1 Q
  1. I Y<0 S DUOUT=1 Q
  1. EXCL1 I Y S SDWLEXCL=1,^TMP("SDWLQSR",$J,"EXCL")=SDWLEXCL
  1. K DIR,X,Y,SDWLEXCL
  1. Q
  1. QUE ;Queue Report
  1. N ZTQUEUED,POP
  1. K %ZIS,IOP,IOC,ZTIO S %ZIS="MQ" D ^%ZIS G:POP QUE1
  1. S ZTRTN="EN^SDWLRSR",ZTDTH=$H,ZTDESC="WAIT LIST STAT REPORT"
  1. S SDWLTASK="" F S SDWLTASK=$O(^TMP("SDWLQSR",$J,SDWLTASK)) Q:SDWLTASK="" D
  1. .S SDWLTK=$G(^TMP("SDWLQSR",$J,SDWLTASK))
  1. .S ZTSAVE(SDWLTASK)=SDWLTK
  1. I $D(IO("Q")) K IO("Q") D ^%ZTLOAD W !,"REQUEST QUEUED" G QUE2
  1. QUE1 S:$E(IOST,1,2)="C-" SDWLSPT=1 I $D(ZTRTN) U IO D @ZTRTN K SDWLSPT
  1. ;
  1. ;
  1. QUE2 K SDWLTASK,SDWLY,SDWLED,WDWLBD,SDWLOPEN,SDWLDATE,SDWLFORM,SDWLPRI
  1. K DIR,DIC,DR,DIE
  1. D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@"
  1. Q
  1. END D EN^SDWLKIL
  1. K DUOUT,SDWLBDT,SDWLEDT,SDWLERR,SDWLIST,SDWLPROM,SDWLTK
  1. Q
  1. HD ;
  1. W:$D(IOF) @IOF W !,?80-$L("Wait List Stat Report")\2,"Wait List Stat Report",!
  1. Q