source: FOIAVistA/trunk/r/LAB_SERVICE-LR-LS/LRLIST.m@ 1540

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

initial load of FOIAVistA 6/30/08 version

File size: 6.8 KB
Line 
1LRLIST ;SLC/RWF/CJS - LAB RESULTS LIST ;2/19/91 10:39
2 ;;5.2;LAB SERVICE;**44,86,153,201**;Sep 27, 1994
3 W !,"Summary List (Supervisors') >>> NOT FOR WARD USE <<<",!
4EN K ^TMP("LR",$J),LRAA
5 D DATE^LRWU G END:Y<1 S LRAD=Y,DIC="^LRO(68,",DIC(0)="AEQ",LRNL=0
6 S LRRDT=$$FMTE^XLFDT(Y,1)
7 F D ^DIC Q:Y<1 D CHKDAT^LRLSTWRL Q:Y<1 S DIC("A")="ANOTHER ONE: ",LRNL=LRNL+1,LRAA(LRNL)=+Y,LRAA(LRNL,1)=$P(Y,U,2),LRSS(LRNL)=$P(^LRO(68,LRAA(LRNL),0),U,2)
8 K DIC G EN:$G(LRNL)<1
9 S LRDATE=-1 I $P(^LRO(68,LRAA(1),0),U,2)="MI" S %DT("A")="Report date approved to display: " D DATE^LRWU G END:$G(LREND) S LRDATE=Y
10C K DIRUT,DIR S DIR("A")="List By",DIR(0)="S^1:ACCESSION NUMBER;2:PATIENT"
11 D ^DIR G:$D(DTOUT)!($D(DUOUT))!($D(DIRUT)) END
12 S LRX=Y
13 D RANGE G:$D(DTOUT)!($D(DUOUT))!($D(DIRUT)) C
14INST K DIR S DIR(0)="PO^4:AQENM",DIR("A")="Optional - Select Collecting Institution "
15 F D ^DIR Q:Y=""!($E(Y=U))!(Y<1) S:Y LRINST=+Y,LRINST(LRINST)="",DIR("A")="Select Another Collecting Institution "
16 K DIR,DIRUT G:$E(Y)=U END
17ALL W !!?5,"Do you wish to see all tests including Common Accessions " S %=1 D YN^DICN G:%=0 ALL G:%<1 END S:%=1 LRALL=""
18 S %ZIS="MQ" D ^%ZIS G END:POP
19 I $D(IO("Q")) S ZTRTN="DQ^LRLIST",ZTIO=ION,ZTDESC="Summary List (Supervisors')",ZTSAVE("LR*")="" D ^%ZTLOAD G END
20C2 S $P(LREQ,"=",IOM)="",S=1 K DX S DX(0)="Q"
21 I $E(IOST,1,2)="C-" S DX(0)="S S=$Y I S>(IOSL-8) N X,Y K DIR S DIR(0)=""E"" D ^DIR K DIR S S=$S($D(DIRUT):0,1:1) Q:$D(DIRUT) W @IOF D HDR^LRLIST S S=$S($D(DIRUT):0,1:1)"
22 I IOST?1"P".E S DX(0)="S S=$Y I S>(IOSL-8) W @IOF D HDR^LRLIST S S=$Y"
23 U IO D HDR G L10:LRX=1,L20:LRX=2,END
24L10 I $D(LRALL) F LRAA=1:1:LRNL F LRL=LRFAN-1:0 S LRL=$O(^LRO(68,LRAA(LRAA),1,LRAD,1,LRL)) Q:(LRL>LRLAN)!(LRL<LRFAN)!(S=0) S ^TMP("LR",$J,LRL,LRAA)=""
25 I '$D(LRALL) F LRAA=1:1:LRNL S LRL=LRFAN-1 F S LRL=$O(^LRO(68,LRAA(LRAA),1,LRAD,1,LRL)) Q:(LRL>LRLAN)!(LRL<LRFAN) I $O(^(LRL,4,0)) S ^TMP("LR",$J,LRL,LRAA)=""
26 F LRAN=0:0 S LRAN=$O(^TMP("LR",$J,LRAN)) Q:LRAN<1!($D(DIRUT))!($D(DUOUT))!($D(DUOUT)) F LRAA=0:0 S LRAA=$O(^TMP("LR",$J,LRAN,LRAA)) Q:LRAA<1 D PR Q:$D(DTOUT)!($D(DUOUT))!($D(DIRUT))
27 W !! G:$D(DTOUT)!($D(DUOUT))!($D(DIRUT)) END
28 W "END OF REPORT",! G END
29L20 F LRAA=1:1:LRNL D L22 Q:$D(DTOUT)!($D(DUOUT))!($D(DIRUT))!(S=0)
30 S LRPNM=""
31 F S LRPNM=$O(^TMP("LR",$J,LRPNM)) Q:LRPNM=""!($D(DTOUT))!($D(DUOUT))!($D(DIRUT)) S PNM=$P(LRPNM,U),SSN=$P(LRPNM,U,2) D L26
32 W !! G:$D(DTOUT)!($D(DUOUT))!($D(DIRUT)) END
33 W !,"END OF REPORT",! G END
34L22 F LRAN=LRFAN-1:0 S LRAN=$O(^LRO(68,LRAA(LRAA),1,LRAD,1,LRAN)) Q:LRAN<1!(LRAN>LRLAN)!($D(DTOUT))!($D(DUOUT))!($D(DIRUT))!(S=0) D L23
35 Q
36L23 I '$D(LRALL),'$O(^LRO(68,LRAA(LRAA),1,LRAD,1,LRAN,4,0)) Q
37 I $G(LRINST),'$D(LRINST(+$P($G(^LRO(68,LRAA(LRAA),1,LRAD,1,LRAN,.3)),U,3))) Q
38 Q:'$D(^LRO(68,LRAA(LRAA),1,LRAD,1,LRAN,0)) Q:'$D(^(3)) S LRDFN=+^(0),LRDPF=$P(^LR(LRDFN,0),U,2),DFN=$P(^(0),U,3) D DEM^LRX S:$L(PNM) ^TMP("LR",$J,PNM_U_SSN,LRAA,LRAN)=DOB Q
39L26 F LRAA=0:0 S LRAA=$O(^TMP("LR",$J,LRPNM,LRAA)) Q:LRAA<1!($D(DTOUT))!($D(DUOUT))!($D(DIRUT))!(S=0) D L28
40 Q
41L28 F LRAN=0:0 S LRAN=$O(^TMP("LR",$J,LRPNM,LRAA,LRAN)) Q:LRAN<1!($D(DTOUT))!($D(DUOUT))!($D(DIRUT))!(S=0) D PR
42 Q
43PR ;
44 I '$D(^LRO(68,LRAA(LRAA),1,LRAD,1,LRAN,0)) W !!?10," Accession ",LRAN," deleted ",!!,$C(7) Q
45 I $G(LRINST),'$D(LRINST(+$P($G(^LRO(68,LRAA(LRAA),1,LRAD,1,LRAN,.3)),U,3))) Q
46 Q:'$D(^LRO(68,LRAA(LRAA),1,LRAD,1,LRAN,3))
47 S LRIDT=9999999-^(3),LRDFN=+^LRO(68,LRAA(LRAA),1,LRAD,1,LRAN,0),LRINT=$P(^(0),U,5),LRODT=$P(^(0),U,4) G PR1:LRDATE<1
48 S LRSET=0 F I=1,5,8,11,16 I $D(^LR(LRDFN,"MI",LRIDT,I)),+^(I)=LRDATE S LRSET=1 Q
49 Q:'LRSET
50PR1 S LRDPF=$P(^LR(LRDFN,0),U,2),DFN=$P(^(0),U,3) D DEM^LRX
51 ;I $E(IOST,1,2)="C-",$Y>(IOSL-8) N X,Y K DIR S DIR(0)="E" D ^DIR K DIR Q:$D(DIRUT)!($D(DUOUT))!($D(DTOUT))!(S=0) W @IOF D HDR S S=$Y
52 ;I IOST?1"P".E&($Y>(IOSL-6)) W @IOF D HDR ;ONLY FOR USE ON A PRINTER
53 X DX(0) Q:S=0
54 D DASH^LRX W !!,PNM,?40,SSN,!,LRAA(LRAA,1)," ACC: ",$S($D(^LRO(68,+LRAA(LRAA),1,LRAD,1,LRAN,.2)):^(.2),1:"no acc")
55 W ?45,$S($D(^LRO(68,+LRAA(LRAA),1,LRAD,1,LRAN,.1)):" ORDER #: "_^(.1),1:"")
56 I LRINT S LRINT=$S($D(^LRO(69,LRODT,1,LRINT,0)):$P(^(0),U,2),1:"") I LRINT S LRINT=$P($G(^VA(200,LRINT,0)),U,1) W !,"Person placing order: ",LRINT
57 I $D(^LRO(68,+LRAA(LRAA),1,LRAD,1,LRAN,4)) D
58 . S LRIN=+$O(^(4,"B",0))
59 . I LRIN,$D(^LRO(68,+LRAA(LRAA),1,LRAD,1,LRAN,4,LRIN)) D
60 .. S LRIN=$P($G(^(LRIN,0)),U,4)
61 .. S:$G(LRIN) LRIN=$E($P(^VA(200,LRIN,0),U),1,10)
62 .. W:$L(LRIN) " Person performing test: ",LRIN
63 X DX(0) Q:S=0
64 I '$D(LRSS(+$G(LRAA))) W !," ACCESSION #: ",LRAN," HAS AN ERROR NOTIFY SYSTEM MANAGER >>> ",!! Q
65 IF '$D(^LR(LRDFN,LRSS(LRAA),LRIDT,0)) W !," ACCESSION #: ",LRAN," >>>>ERROR PLEASE NOTIFY SYSTEM MANAGER<<<<<",! Q
66 W ! S DIC="^LR("_LRDFN_","""_LRSS(LRAA)_""",",DR="0"_$S(LRLONG:":99999999",1:""),DA=LRIDT
67 X DX(0) Q:S=0 D EN^LRDIQ Q:$D(DTOUT)!($D(DUOUT))!($D(DIRUT))!(S=0)
68 I $G(LRLONG)=2 F DR="ORU","ORUT" Q:S=0 X DX(0) Q:S=0 D EN^LRDIQ Q:$D(DTOUT)!($D(DUOUT))!($D(DIRUT))!(S=0)
69 Q
70TOF Q:S=0 X DX(0)
71 ;S S=$Y I $E(IOST,1,2)="P-",$Y>(IOSL-6) W @IOF D HDR S S=$Y Q
72 ;I $E(IOST,1,2)="C-",$Y>(IOSL-8) N X,Y S DIR(0)="E" D ^DIR K DIR Q:$D(DIRUT)!($D(DUOUT))!($D(DTOUT))!(S=0) W @IOF D HDR S S=$Y
73 Q
74END W ! W:$E(IOST,1,2)="P-" @IOF D ^%ZISC
75 K DIC,D1,DIR,A,AGE,DFN,DOB,DR,LRAN,LRINST,S,SEX,T,ZZ,ZZY
76 K LRNG1,LRNG11,LRNG12,LRNG2,LRNG3,LRNG4,LRNG5
77 K DTOUT,DUOUT,DIRUT,LR,LRDFN,LRDPF,LRIDT,LRODT,LRPRAC,LRRB,LRTREA,LRWRD,PNM
78 K SSN,VA,LREQ
79 K ^TMP("LR",$J),LRPNM,LRDATE,LRLONG,ZTRTN,ZTIO,ZTDESC,ZTSAVE,ZTSK,%H
80 K C1,D0,DA,DICS,DL,DSC,DX,LRL,LAST,LRAA,LRAD,LRALL,LRDX,LREDT,LREND,LRFAN
81 K LRIN,LRINT,LRLAN,LRLINE,LRNL,LRSET,LRSS,LRWDTL,LRRDT,LRRPG,LRX,POP,IO("Q")
82 D KVAR^VADPT Q
83HDR I $G(LRDBUG),$S($D(DTOUT):1,$D(DUOUT):1,$D(DIRUT):1,S=0:1,1:0) W !,"88888"
84 Q:$D(DTOUT)!($D(DUOUT))!($D(DIRUT))!(S=0)
85 I '$G(LRRPG) S LRRPG=1 W:$E(IOST,1,2)="C-" @IOF
86HD1 W "SUMMARY LIST (SUPERVISORS') FOR DATE: ",LRRDT,?(IOM-12),"PAGE: ",LRRPG,!
87 W " >> NOT FOR WARD USE <<" W:$L(LRRDT)=4 ?40,"Report for date: ",$$FMTE^XLFDT($S(LRDATE>0:LRDATE,1:$$NOW^XLFDT),"D")
88 W !,"ACCESSION AREA(S) :" F ZZ=1:1:LRNL W LRAA(ZZ,1)," "
89 I $O(LRINST(0)) W !,"Collecting Site(s) " S ZZ=0 F S ZZ=$O(LRINST(ZZ)) Q:ZZ="" W $P(^DIC(4,ZZ,0),U)," / "
90 W !,LREQ S S=$Y
91 S LRRPG=LRRPG+1
92 Q
93RANGE K DIR,DIRUT S DIR("B")="S",DIR(0)="S^L:LONG;S:SHORT;E:EXTENDED",LRLONG=0
94 S DIR("?")="Long listing shows verified results where short list does not."
95 S DIR("?",1)="Extened provides demographics results and normal ranges."
96 D ^DIR K DIR
97 Q:$D(DTOUT)!($D(DUOUT))!($D(DIRUT))
98 S LRLONG=$S(Y["L":1,Y["E":2,1:0)
99 D LRAN^LRWU3 Q
100TST S LRAA(1)=42,LRAA(1,1)="CHEMISTRY",LRNL=1,LRALL="",LRSS(1)="CH"
101 ;LRAD=DATE TO SCAN,LRRDT=DATE PRINT FORMAT,LRFAN=STARTING NUMBER
102 ;LRX=REPORT SORT,LRLAN=LAST ACCESSION #
103DQ U IO S:$D(ZTQUEUED) ZTREQ="@"
104 S:'$D(LRLONG) LRLONG=1
105 I '$G(LRAD) S X="T-1",%DT="X" D ^%DT S LRAD=Y
106 I '$L($G(LRRDT)) S LRRDT=$$FMTE^XLFDT(LRAD,1)
107 S:'$G(LRX) LRX=2 S:'$D(LRFAN) LRFAN=1
108 S:'$G(LRLAN) LRLAN=30
109 S:'$G(LRDATE) LRDATE=-1
110 G C2
Note: See TracBrowser for help on using the repository browser.