source: WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LRTT5.m@ 1789

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

initial load of WorldVistAEHR

File size: 4.3 KB
Line 
1LRTT5 ;DALISC/FHS - LAB URGENCY TURNAROUND TIMES ; 12/3/1997
2 ;;5.2;LAB SERVICE;**153,201**;Sep 27, 1994
3EN ;
4ONE S LREND=0 D ^LRPARAM G:$G(LREND) STOP
5 S LRPTITLE="Urgency Turnaround Time",LRPQNUM=1 K LRPQ
6 ; from LRTT5
7 ; get default dates from QUIC Extract file - if current survey
8 W @IOF S LRPOPTN="",LREDT=LRDT0
9 D TITLE("TQD")
10 D ^LRWU3 G:$G(LREND) STOP S LRPSDT=LRSDT,LRPEDT=LREDT
11 W !!,"Select the laboratory tests to be used in this report --",!
12 K DIC,^TMP("LRTT5",$J) S DIC=60,DIC(0)="AEMOQZ",DIC("A")=" LABORATORY TEST: "
13 S ^TMP("LRTT5",$J,0)=DT_U_DT_U_"LAB URGENCY TURNAROUND TIMES"
14 F D ^DIC Q:Y<1 S ^TMP("LRTT5",$J,"TESTS",+Y)=$P(Y(0),U)
15 K DIC I '$D(^TMP("LRTT5",$J,"TESTS")) G STOP
16 W !!,"Urgencies:" S LRX=0 F S LRX=$O(^LAB(62.05,LRX)) Q:LRX>49!(LRX<1) W:$D(^(LRX,0)) !?10,$P(^(0),U)
17 W !,"Enter all urgencies you want extracted." S DIC=62.05,DIC(0)="AEMOQZ",DIC("A")=" URGENCY: ",DIC("S")="I +Y<49"
18 F D ^DIC Q:Y<1 S LRPQ("URGENCY",+Y)=$P(Y(0),U) S:$D(^LAB(62.05,(+Y+50),0)) LRPQ("URGENCY",(+Y+50))=$P(^(0),U)
19 K DIC I '$D(LRPQ("URGENCY")) G STOP
20 K DIC,DIR S DIR(0)="PO^DIC(4,:AENM",DIR("A")="Select Division(s) "
21 W !!?10,"<Optional Screen> Press return to select all divisions",! D
22 . F D READ Q:$G(LREND)!(Y<1) S LRLLOC(+Y)=Y
23 I $D(LRPQ) D DETAIL I LRPDET<0 K LRPQ
24 I $D(LRPQ) D DEV
25 D CLEANUP
26 Q
27DETAIL ; detailed report=1, no detailed report=0, exit=-1
28 F W !!,"Include a detailed report" S %=2 D YN^DICN Q:% W " enter 'Y'es or 'N'o"
29 S LRPDET=$S(%=1:1,%=2:0,1:-1)
30 Q
31DEV ;
32 W !! S %ZIS="Q" D ^%ZIS I POP Q
33 I '$D(IO("Q")) D REPORT Q
34 S ZTIO=ION,ZTSAVE("^TMP(""LRTT5"",$J,")="",ZTSAVE("LR*")="",ZTDESC="LAB - "_LRPTITLE,ZTRTN="REPORT^LRTT5" D ^%ZTLOAD W !,$S($D(ZTSK):"Request queued",1:"Request canceled") D HOME^%ZIS K ZTSK Q
35 Q
36REPORT ; dequeued
37 K ^TMP("LR",$J) S ^TMP("LR",$J,0)=DT_U_DT_U_"LAB URGENCY TURNAROUND TIMES"
38 D ONE^LRTT5P1
39 S LRPNOW=$$NOW^XLFDT,LRPTBF=$$FMTE^XLFDT(LRPSDT),LRPTEF=$$FMTE^XLFDT(LRPEDT)
40 U IO W:$E(IOST,1,2)="C-" @IOF D HDR
41 I $O(^TMP("LR",$J,0))="" W !!!,"No data to report" G CLEANUP
42 D ONE^LRTT5R1
43 I '$G(LREND) W !!?20,"****** END OF REPORT ********"
44 D CLEANUP
45 Q
46LNCHECK ; from LRTT5R*
47 Q:$G(LREND) I $Y>(IOSL-6) D
48 . I $E(IOST,1,2)="C-" K DIR S DIR(0)="E" D ^DIR S:$G(DIRUT) LREND=1 Q:LREND D DHDR Q
49 . D DHDR
50 Q
51DHDR ; from LRTT5R*
52 Q:$G(LREND) W @IOF D HDR S LRPPAGE=$G(LRPPAGE)+1,LRPDTHDR="LEDI - "_LRPTITLE_" - DETAILED " W ?(IOM-$L(LRPDTHDR)\2),LRPDTHDR,?(IOM-15),"PAGE ",LRPPAGE,!,LRPDHEAD,!
53 Q
54HDR Q:$G(LREND)
55 F LRPLN=$G(LRPVAMC),"LEDI Management Report - "_LRPTITLE,"From "_LRPTBF_" To "_LRPTEF,"Date Printed: "_$$FMTE^XLFDT($$NOW^XLFDT) W !?(IOM-$L(LRPLN)\2),LRPLN
56 S LRPLN="",$P(LRPLN,"_",IOM+1)="" W !,LRPLN,!
57 Q
58CLEANUP ;
59STOP K ^TMP("LR",$J),^TMP("LRTT5",$J) I $D(ZTQUEUED) S ZTREQ="@"
60 W !! W:$E(IOST,1,2)="P-" @IOF D ^%ZISC
61 K %,%I,%DT,%ZIS,%T,%Y,C,DIC,DFN,DTOUT,DUOUT,POP,DIR,LRPVAMC
62 K LRAA,LRAASUB,LRAAT,LRPAC,LRPALOC,LRPALRSP,LRAN,LRPCNT,LRPDET,LRDPF
63 K LRPDHEAD,LRPDIFF,LRPDNODE,LRPDTHDR,LRPDTYPE,LRPITB,LRPITE,LRAD,LRPLINE,LRPLN
64 K LRLOC,LRLLOC,LRLOC44,LRLOCX,LRPLRAC,LRPLRDC,LRPLRDFN,LRPLRDN,LRPLRIDT,LRPLRRX,LRPLRRX1,LRPLRRX2
65 K LRPLRSP,LRPLRSS,LRPLRST,LRPLRT,LRPLRTN,LRPLRTS,LRPMERGE,LRPN,LRPNN,LRPNNUM,LRPNOW
66 K LRPNT,LRPNUM,LRPOC,LRPOCM,LRPOCNT,LRPOCT,LRPOCTT,LRPOK,LRPOOS,LRPORG,LRPORGN,LRPOS,LRPPAGE
67 K LRPPATN,LRPPDOC,LRPQ,LRPQNUM,LRPRX1D,LRPRX1T,LRPSP,LRPSPEC,LRPSPN,LRPTB,LRPTBF
68 K LRPTE,LRPTEF,LRTEST,LRTESTN,LRPTITLE,LRPTYPE,LRX,LREDT,LRSDT
69 K LRPERR,VA,VADM,VAIN,X,X1,X2,Y,ZTDESC,ZTRTN,ZTSAVE,ZTSK,LRPSDT
70 K LRPEDT,LRPOPTN,LREND
71 Q
72LRTT5U ;
73TITLE(LRPUTYPE) ; from LRTT5, LRTT5A, displays "T" title, "Q" question, "D" description
74 I LRPUTYPE["T" S LRPLN="LEDI Utility - "_LRPTITLE W !!?(IOM-$L(LRPLN)\2),LRPLN,!
75 I LRPUTYPE["D" D
76 .I LRPQNUM=1 F LRPOS=1:1 S LRPLN=$P($T(ONED+LRPOS),";;",2) Q:LRPLN="" W !,$$CJ^XLFSTR(LRPLN,IOM)
77 .W !!
78 Q
79ONED ; description 1
80 ;;This option generates a report of the turnaround time for selected lab
81 ;;tests. Enter only those urgencies you want extracted. WKLD urgencies will
82 ;;be included for each normal urgency selected. Enter the
83 ;;test(s) you want the report display.
84 ;; -
85 ;;A detailed report is available to show the data being used to
86 ;;compute the turnaround times.
87 ;; -
88 ;;Regular hours are from 7:01 AM to 5:00PM
89 ;;Irregular hours includes all other times, holidays and weekends.
90 ;;
91 ;
92 ;
93 Q
94READ ;
95 D ^DIR S:$D(DTOUT)!($D(DUOUT)) LREND=1
96 Q
Note: See TracBrowser for help on using the repository browser.