source: FOIAVistA/trunk/r/LAB_SERVICE-LR-LS/LRRP6A1.m@ 1650

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

initial load of FOIAVistA 6/30/08 version

File size: 3.4 KB
Line 
1LRRP6A1 ;DALISC/J0 - LAB TEST SUMMARY REPORT-BUILD ;11/27/92
2 ;;5.2;LAB SERVICE;**201**;Sep 27, 1994
3EN ;
4DQ ;
5 D INIT S:$D(ZTQUEUED) ZTREQ="@" K ZTSK
6 S ACCTRNS=$P(^LRO(68,LRAA,0),U,3) Q:"MDQY"'[ACCTRNS
7 I ACCTRNS="D" D DAILY
8 I ACCTRNS="Y" D YEARLY
9 I ACCTRNS="M"!(ACCTRNS="Q") D MONTHLY
10 D PRINT
11 D:$D(ZTQUEUED) WRAPUP^LRRP6
12 Q
13INIT ;
14 S:$D(ZTQUEUED) ZTREQ="@" K ZTSK U IO
15 K ^TMP("LR",$J)
16 S LRDAT=$$Y2K^LRX(DT),(LRPAG,LREND)=0
17 Q
18DAILY ;
19 S LRDT=LRSDT
20 F S LRDT=$O(^LRO(68,LRAA,1,LRDT)) Q:('LRDT)!(LRDT>LREDT) D
21 . S LRANN=+$G(LRANF)
22 . F S LRANN=$O(^LRO(68,LRAA,1,LRDT,1,LRANN)) Q:'LRANN!(LRANN>LRANL) S LRPDT=+$P($G(^(LRANN,3)),U,3) D ACC
23 Q
24YEARLY ;
25 S LRDT=$E(LRSDT,1,3)_"0000"-.001,LREDT=LREDT_".99999"
26 F S LRDT=$O(^LRO(68,LRAA,1,LRDT)) Q:('LRDT)!(LRDT>LREDT) D
27 . S LRANN=+$G(LRANF)
28 . F S LRANN=$O(^LRO(68,LRAA,1,LRDT,1,LRANN)) Q:'LRANN!(LRANN>LRANL) D
29 . . Q:'$D(^LRO(68,LRAA,1,LRDT,1,LRANN,0))#2 S LRANN0=+$P($G(^(3)),U,3)
30 . . I LRANN0,LRANN0'>LREDT&(LRANN0'<LRSDT) S LRPDT=LRANN0 D ACC
31 Q
32MONTHLY ;
33 S LRDT=$E(LRSDT,1,5)_"00"-.001,LREDT=LREDT_".99999"
34 F S LRDT=$O(^LRO(68,LRAA,1,LRDT)) Q:('LRDT)!(LRDT>LREDT) D
35 . S LRANN=+$G(LRANF)
36 . F S LRANN=$O(^LRO(68,LRAA,1,LRDT,1,LRANN)) Q:'LRANN!(LRANN>LRANL) D
37 . . Q:'$D(^LRO(68,LRAA,1,LRDT,1,LRANN,0))#2 S LRANN0=+$P($G(^(3)),U,3)
38 . . I LRANN0,LRANN0'>LREDT&(LRANN0'<LRSDT) D ACC
39 Q
40ACC ;
41 S LRAN=$G(^LRO(68,LRAA,1,LRDT,1,LRANN,.2)) Q:LRAN=""
42 S LRTIC=$P(LRAN," ",3)
43 S LRTIC=$S($L(LRTIC)'>1:"00"_LRTIC,$L(LRTIC)'>2:"0"_LRTIC,1:LRTIC)
44 S LRAN=$E(LRAN,1,$L(LRAN)-$L($P(LRAN," ",3)))_LRTIC
45 S LRTST=0
46 F S LRTST=$O(^LRO(68,LRAA,1,LRDT,1,LRANN,4,LRTST)) Q:'LRTST D
47 . S LRTNAM=$E($$TST^LRCAPR2(LRTST),1,60)
48 . S LRCPN=0
49 . F S LRCPN=$O(^LRO(68,LRAA,1,LRDT,1,LRANN,4,LRTST,1,LRCPN)) Q:'LRCPN D
50 . . S LRNODE=$G(^LRO(68,LRAA,1,LRDT,1,LRANN,4,LRTST,1,LRCPN,0)) Q:'LRNODE
51 . . Q:$P(LRNODE,U,3)'=1
52 . . S LRMULT=+$P(LRNODE,U,4)
53 . . I $D(LRDIVSEL),'$D(LRDIVSEL(+$P(LRNODE,U,8)))#2 Q
54 . . S LRCAPNAM=$E($$WKLDNAME^LRCAPU(LRCPN),1,60)
55 . . Q:('$L(LRCAPNAM))!('LRCAPNUM)
56 . . S LRCC(LRCAPNAM)=LRCAPNUM
57 . . D BMPTOTS
58 Q
59BMPTOTS ;
60 S LRANX=LRAN N LRAN
61 S LRAN=LRANX_"~"_LRDT
62 S:'$D(^TMP("LR",$J))#2 ^($J)=0
63 S ^($J)=^TMP("LR",$J)+LRMULT
64 S:'$D(^TMP("LR",$J,"ACCNUM",LRAN))#2 ^(LRAN)=0
65 S ^(LRAN)=^TMP("LR",$J,"ACCNUM",LRAN)+LRMULT
66 ;***S:'$D(^TMP("LR",$J,"ACCNUM",LRAN,LRTNAM))#2 ^(LRTNAM)=0
67 ;***S ^(LRTNAM)=^TMP("LR",$J,"ACCNUM",LRAN,LRTNAM)+LRMULT
68 S:'$D(^TMP("LR",$J,"ACCNUM",LRAN,LRTNAM,LRCAPNAM))#2 ^(LRCAPNAM)=0
69 S ^(LRCAPNAM)=^TMP("LR",$J,"ACCNUM",LRAN,LRTNAM,LRCAPNAM)+LRMULT
70 S:'$D(^TMP("LR",$J,"WKLD",LRCAPNAM))#2 ^(LRCAPNAM)=0
71 S ^(LRCAPNAM)=^TMP("LR",$J,"WKLD",LRCAPNAM)+LRMULT
72 S:'$D(^TMP("LR",$J,"TST"))#2 ^("TST")=0
73 S ^("TST")=^TMP("LR",$J,"TST")+LRMULT
74 S:'$D(^TMP("LR",$J,"TST",LRTNAM))#2 ^(LRTNAM)=0
75 S ^(LRTNAM)=^TMP("LR",$J,"TST",LRTNAM)+LRMULT
76 S:'$D(^TMP("LR",$J,"TST",LRTNAM,LRCAPNAM))#2 ^(LRCAPNAM)=0
77 S ^(LRCAPNAM)=^TMP("LR",$J,"TST",LRTNAM,LRCAPNAM)+LRMULT
78 Q
79PRINT ;
80 W:$E(IOST,1,2)="C-" @IOF
81 S $P(LRDASH,"=",IOM)="",$P(LRSTAR,"*",IOM)=""
82 I '$D(^TMP("LR",$J)) D NOTHING Q
83 D:LRREPTYP="D" DET^LRRP6A3 Q:LREND
84 D COND^LRRP6A2
85 Q
86NOTHING ;
87 S LRPAG=LRPAG+1
88 W LRDASH
89 W !,"Lab Test Summary for ",LRDATRNG
90 W ?62,LRDAT,?72,"PAGE ",$J(LRPAG,3)
91 W !,"Accession Area: ",LRX
92 W !,LRSTAR
93 W !!?18,"*** NO DATA FOR REPORT OPTIONS SELECTED ***"
94 I $D(LRDIVSEL) D
95 . W !!,"DIVISIONS SELECTED",!,$E(LRDASH,1,18)
96 . S LRDIV=""
97 . F S LRDIV=$O(LRDIVSEL(LRDIV)) Q:LRDIV="" W !,LRDIVSEL(LRDIV)
98 Q
Note: See TracBrowser for help on using the repository browser.