source: WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LRARCML2.m@ 1211

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

initial load of WorldVistAEHR

File size: 3.4 KB
Line 
1LRARCML2 ;DALISC/CKA - ARCHIVED WKLD COST REP BY MAJ SCTN; 5/22/95
2 ;;5.2;LAB SERVICE;**59**;Aug 31, 1995
3 ;same as LRCAPML2 except archived wkld data file
4EN ;
5TOP ;
6 N LRCCNT,LRICNT,LROCNT,LRNCNT,LRACNT,LRCST,LRIST,LROST,LRNST,LRAST
7 S LRHDR="ARCHIVED WORKLOAD COST REPORT BY MAJOR SECTION"
8 S LRHDR2="REPORT DATE RANGE: "_LRDT1_" - "_LRDT2
9 D PRTINIT^LRARCU
10 S (LRGT,LRGTU)=0
11 S LRGTREC=$G(^TMP("LRAR-WL",$J,0))
12 I $L(LRGTREC) S LRGT=+$P(LRGTREC,U),LRGTU=+$P(LRGTREC,U,2)
13 I $E(IOST,1,2)="C-" W @IOF
14 D:'LRSUMM DET
15 D:'LREND SUM^LRARCML3
16 D:'LREND PRNTMAN^LRARCMR1
17 D:'LREND COMM^LRARCMR2
18 Q
19DET ;Detailed section
20 F LRLDIV="AP","CP" D Q:LREND
21 . S LRHDR3=$S(LRLDIV="AP":"ANATOMIC PATHOLOGY",1:"CLINICAL PATHOLOGY")
22 . S LRIN=0
23 . F S LRIN=$O(^TMP("LRAR-WL",$J,"DIV",LRLDIV,LRIN)) Q:('LRIN)!(LREND) D
24 . . S LRINN=$S($D(^LAR(64.19999,LRIN,0)):^(0),1:"UNDEFINED")
25 . . S (LRIGT,LRIGTU)=0
26 . . S LRGTREC=$G(^TMP("LRAR-WL",$J,"DIV",LRLDIV,LRIN,0))
27 . . I $L(LRGTREC) S LRIGT=+$P(LRGTREC,U),LRIGTU=+$P(LRGTREC,U,2)
28 . . D PRTDET
29 . . D:('LREND)&(LRIGTU) INSTSUM
30 Q
31PRTDET ; PRINT THE REPORT
32 D HDR^LRARCU
33 W !,?(80-$L(LRINN)\2),LRINN,!!
34 S LRMAA=""
35 F S LRMAA=$O(^TMP("LRAR-WL",$J,"DIV",LRLDIV,LRIN,LRMAA)) Q:(LRMAA="")!($G(LREND)) D
36 . S LRLSSA=""
37 . F S LRLSSA=$O(^TMP("LRAR-WL",$J,"DIV",LRLDIV,LRIN,LRMAA,LRLSSA)) Q:(LRLSSA)=""!(LREND) D LSS Q:LREND
38 Q:LREND
39 I $Y>(IOSL-5) D NPG^LRARCU Q:LREND W !,?(80-$L(LRINN)\2),LRINN,!!
40 I 'LRIGTU D
41 . W !!!,"NO DATA FOR THIS INSTITUTION AND DATE RANGE",!
42 E D
43 . W !!!,"GRAND TOTAL",?52,$J(LRIGTU,7),?65,$J(LRIGT,9,2),!
44 D:($E(IOST,1,2)="C-")&('LREND) PAUSE^LRARCU W @IOF
45 Q
46INSTSUM ;
47 S LRLAB="!!,?(80-7\2),""SUMMARY"",!,?(80-$L(LRINN)\2),LRINN,!!,""MAJOR SECTION"",?15,""LAB SUBSECTION"",?31,""UNIT COUNT"",?45,"" %"",?55,""TOTAL COST"",?70,"" %"",!"
48 D HDR^LRARCU W @LRLAB
49 S LRMAA=""
50 F S LRMAA=$O(^TMP("LRAR-WL",$J,"DIV",LRLDIV,LRIN,LRMAA)) Q:(LRMAA="")!(LREND) D
51 . S LRLSSA=""
52 . F S LRLSSA=$O(^TMP("LRAR-WL",$J,"DIV",LRLDIV,LRIN,LRMAA,LRLSSA)) Q:(LRLSSA="")!(LREND) D PSUM
53 I $Y>(IOSL-4) D NPG^LRARCU Q:LREND W @LRLAB
54 W !!,"GRAND TOTAL",?31,$J(LRIGTU,7),?55,$J(LRIGT,9,2)
55 D:($E(IOST,1,2)="C-")&('LREND) PAUSE^LRARCU W @IOF
56 Q
57PSUM ;
58 Q:LREND
59 S LRX=$G(^TMP("LRAR-WL",$J,"DIV",LRLDIV,LRIN,LRMAA,LRLSSA,0))
60 Q:'$L(LRX)
61 I $Y>(IOSL-3) D NPG^LRARCU Q:LREND W @LRLAB
62 W !,$E(LRMAN(LRMAA),1,14),?15,$E(LRLSSN(LRLSSA),1,15)
63 W ?31,$J($P(LRX,U,2),7),?45,$J($P(LRX,U,2)/LRIGTU*100,5,1)
64 W ?55,$J($P(LRX,U,1),9,2)
65 W ?70,$J($P(LRX,U)/$S(LRIGT=0:1,1:LRIGT)*100,5,1),!
66 Q
67LSS ;
68 S LRLAB="!!,""MAJOR SECTION: "",LRMAN(LRMAA),!,""LAB SUBSECTION: "",LRLSSN(LRLSSA),!!,""CODE"",?11,""PROCEDURE"",?42,""UNIT COST"",?53,""UNIT COUNT"",?65,""TOTAL COST"",?70,"" %"",!"
69 I $Y>(IOSL-7) D NPG^LRARCU Q:LREND W !,?(80-$L(LRINN)\2),LRINN,!
70 W @LRLAB
71 S LRX=$G(^TMP("LRAR-WL",$J,"DIV",LRLDIV,LRIN,LRMAA,LRLSSA,0))
72 S LRST=$P(LRX,U),LRSTU=$P(LRX,U,2)
73 S LRCC=0
74 F S LRCC=$O(^TMP("LRAR-WL",$J,"DIV",LRLDIV,LRIN,LRMAA,LRLSSA,LRCC)) Q:(LRCC="")!(LREND) D PCC
75 Q:LREND
76 I $Y>(IOSL-4) D NPG^LRARCU Q:LREND W !,?(80-$L(LRINN)\2),LRINN,!,@LRLAB
77 W !,?40,"SUB TOTAL",?52,$J(LRSTU,7),?65,$J(LRST,9,2)
78 Q
79PCC ;
80 S LRX=$G(^TMP("LRAR-WL",$J,"DIV",LRLDIV,LRIN,LRMAA,LRLSSA,LRCC))
81 I $Y+3>IOSL D NPG^LRARCU Q:LREND W !,?(80-$L(LRINN)\2),LRINN,!,@LRLAB
82 W $P(LRX,"^",4),?11,$E(LRCC,1,30),?43,$J(+$P(LRX,"^",3),6,2)_$S($P(LRX,"^",3)["*":"*",1:"")
83 W ?52,$J(+$P(LRX,"^"),7),?65,$J(+$P(LRX,"^",2),9,2)
84 W ?75,$J($P(LRX,U)/$S(LRSTU=0:1,1:LRSTU)*100,5,1),!
85 Q
Note: See TracBrowser for help on using the repository browser.