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

SDWLQOF.m

Go to the documentation of this file.
  1. SDWLQOF ;;IOFO BAY PINES/TEH - OVERDUE APPOINTMENT
  1. ;;5.3;scheduling;**263,414,425,448**;AUG 13 1993
  1. ;
  1. ;
  1. ;******************************************************************
  1. ; CHANGE LOG
  1. ;
  1. ; DATE PATCH DESCRIPTION
  1. ; ---- ----- -----------
  1. ;
  1. EN ;Header
  1. N ZCODE,ZTDESC,ZTDTH,ZTIO,ZTQUEDED,ZTREQ,ZTRTN,ZTSAVE,ZTSK,SDWLSPT
  1. D HD
  1. S SDWLINST="",SDWLERR=0 K ^TMP("SDWLQOF",$J),DIC,DIR,DR,DIE
  1. 1 D INS G END:$D(DUOUT)
  1. 2 D CAT G 1:SDWLERR,END:$D(DUOUT)
  1. 3 D FORM G 2:SDWLERR,END:$D(DUOUT)
  1. 4 D DIS G EN:SDWLERR=1,END:SDWLERR=2
  1. D QUE
  1. Q
  1. INS ;Get Institution
  1. S SDWLERR=0,SDWLPROM="Select Institution ALL // "
  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("SDWLQOF",$J,"INS")="ALL" G IN3
  1. S SDWLPROM="Another Institution: ",SDWLERR=1
  1. G IN:$D(SDWLIN(+Y)) S SDWLIN(+Y)=""
  1. S SDWLINST=SDWLINST_Y_";",SDWLPROM="Another Institution: ",SDWLERR=1 G IN
  1. IN2 S ^TMP("SDWLQOF",$J,"INS")=SDWLINST
  1. IN3 Q
  1. CAT ;Report category selection
  1. K DIR,DIE,DR,DIC
  1. W !!," *** Report Category Selection ***" S SDWLERR=0
  1. S SDWLERR=0,SDWLCAT="",DIR(0)="SO^1:Clinic;2:Select Service/Specialty",DIR("L",1)=" 1. Clinic",DIR("L")=" 2. Service/Specialty"
  1. D ^DIR
  1. I X="^" S SDWLERR=1 W *7 Q
  1. I X="" S SDWLERR=1 W *7 Q
  1. S X=$S(X["C":"C",X["c":"C",X["S":"S",X["s":"S",X=1:"C",X=2:"S",1:"")
  1. I X="" W *7," Invalid Selection." G CAT
  1. W !!,"Select Category for Report Output",!
  1. S SDWLX=$S(X="C":"Clinic: ALL/ ",X="S":"Service/Specialty: ALL/ ")
  1. S SDWLF=$S(X["C":409.32,X["S":409.31,X["c":409.32,X["s":409.31)
  1. S SDWLFD=$S(X="C":8,1:7)
  1. S SDWLCTX=X
  1. K DIR,DIC,DR
  1. S ^TMP("SDWLQOF",$J,"CT1")=SDWLCTX_"^"_SDWLF_"^"_SDWLFD,DIC("A")=SDWLX,SDWLE=0
  1. CT1 W ! S DIC(0)="QEMNZA",DIC=SDWLF D ^DIC I 'SDWLE,Y<1 S ^TMP("SDWLQOF",$J,"CT2")="ALL" G CT3
  1. I Y<0,'$D(^TMP("SDWLQOF",$J,"CT1")) W !,"This Entry is Required." G CAT
  1. G CT2:Y<0
  1. S SDWLCAT=SDWLCAT_Y_";",DIC("A")="Another "_$P(SDWLX,":",1)_": ",SDWLE=1 G CT1
  1. CT2 G CT1:'$D(SDWLCAT) S ^TMP("SDWLQOF",$J,"CT2")=SDWLCAT
  1. CT3 Q
  1. FORM ;Report Format
  1. S SDWLERR=0,DIR(0)="SO^1:D:Detailed;S:Summary",DIR("L",2)=" D Detailed"
  1. S DIR("L")=" S Summary",DIR("L",1)="Select One of the Following: "
  1. D ^DIR
  1. I X="^" S DUOUT=1 Q
  1. S SDWLFORM=$S(X["D":"D",X["d":"D",X["S":"S",X["s":"S",1:"")
  1. I X="" W !,"Required!" G FORM
  1. S ^TMP("SDWLQOF",$J,"FORM")=SDWLFORM
  1. Q
  1. DIS ;Display Parameters
  1. S SDWLERR=0 W !!,?80-$L("*** Selected Report Parameters ***")\2,"*** Selected Report Parameters ***",!
  1. F SDWLI="INS","CT1","CT2","FORM" D
  1. .S X="SDWL"_SDWLI,@X=$G(^TMP("SDWLQOF",$J,SDWLI))
  1. F SDWLTAG="IS","CT","OP" D @SDWLTAG
  1. Q
  1. IS I SDWLINS'["ALL" D
  1. .K SDWLY F I=1:1 S SDWLY=$P($P(SDWLINS,";",I),U,2) Q:SDWLY="" S SDWLY(I)=SDWLY
  1. .W !,?20,"Institution: "
  1. .I $D(SDWLY) S I="" F S I=$O(SDWLY(I)) Q:I="" W:I>1 !,?33 W SDWLY(I)
  1. .K SDWLY
  1. I SDWLINS["ALL" W !,?20,"Institution: ALL "
  1. Q
  1. CT I SDWLCT2'["ALL" D
  1. .S SDWLF=$P(SDWLCT1,U,2)
  1. .K SDWLY F I=1:1 S SDWLY=$P($P(SDWLCT2,";",I),U,2) Q:SDWLY="" S SDWLY(I)=SDWLY
  1. .W !,?16,"Report Category: " W $S(SDWLCT1["C":"Clinic",1:"Service Specialty"),!,?36 I @X="ALL" W "All "
  1. .I $D(SDWLY) S I="" F S I=$O(SDWLY(I)) Q:I="" W:I>1 !,?35 W $$EXTERNAL^DILFD(SDWLF,.01,,SDWLY(I))
  1. I SDWLCT2["ALL" W !,?16,"Report Category: " W $S(SDWLCT1["C":"Clinic",1:"Service Specialty"),!,?36 W "ALL "
  1. Q
  1. OP W !,?18,"Output Format: ",$S(SDWLFORM="D":" Detailed",1:" Summary")
  1. Q
  1. S %=1 W !!,"Are these Parameters Correct " D YN^DICN I %=2 S SDWLERR=1 W !," This Report will NOT be queued to print."
  1. I SDWLERR S DIR(0)="E" D ^DIR I X["^" S SDWLERR=2
  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=$S(SDWLFORM="D":"EN^SDWLROF",1:"EN^SDWLROS"),ZTDTH=$H,ZTDESC="WAIT LIST OVERDUE REPORT"
  1. S SDWLTASK="" F S SDWLTASK=$O(^TMP("SDWLQOF",$J,SDWLTASK)) Q:SDWLTASK="" D
  1. .S SDWLTK=$G(^TMP("SDWLQOF",$J,SDWLTASK))
  1. .S ZTSAVE(SDWLTASK)=SDWLTK
  1. I $D(IO("Q")) K IO("Q") D ^%ZTLOAD W !,"REQUEST QUEUED" G END
  1. QUE1 S:$E(IOST,1,2)="C-" SDWLSPT=1 I $D(ZTRTN) U IO D @ZTRTN K SDWLSPT
  1. ;
  1. END ;
  1. K SDWLTASK,SDWLY,SDWLED,WDWLBD,SDWLOPEN,SDWLDATE,SDWLFORM,SDWLPRI,I
  1. K DIR,DIC,DR,DIE
  1. D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@"
  1. Q
  1. HD W:$D(IOF) @IOF W !,?80-$L("Overdue Appointment Wait List Report")\2,"Overdue Appointment Wait List Report"
  1. Q