source: WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LRAC5.m@ 1394

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

initial load of WorldVistAEHR

File size: 2.0 KB
Line 
1LRAC5 ;SLC/DCM - PRINT CUMULATIVE REPORT ; 12/23/87 11:13 ;
2 ;;5.2;LAB SERVICE;;Sep 27, 1994
3TS2 S LRCW=$P(^LAB(64.5,1,1,LRMH,1,LRSH,1,I(I),0),U,2) Q:(IOM-LRCL)<LRCW S LRCL=LRCL+LRCW,A=$L($P(^LAB(64.5,"A",1,LRMH,LRSH,I(I)),U,7))\2,B=LRCW\2 W $J($P(^(I(I)),U,7),(A+B)),?LRCL S LRFALT=0
4 Q
5TS1 F I=J:1:LRJS I $D(I(I)) S LRCW=$P(^LAB(64.5,1,1,LRMH,1,LRSH,1,I(I),0),U,2),LRCL=LRCL+LRCW D LRLO^LRAC9 S A=$L(LRLOHI)\2,B=LRCW\2 W $J(LRLOHI,(A+B)),?LRCL
6 Q
7TS ;from LRAC3
8 I LRACT'=0 D EQUALS^LRX
9 K I S I=0,LRII=0 F S LRII=$O(^LAB(64.5,1,1,LRMH,1,LRSH,1,LRII)) Q:LRII<1 S I=I+1,I(I)=LRII
10 S LRFALT=0,LRCTR=0,LRACT=LRACT+1,J=LRJS+1,LRCL=$S($D(LRCALE(LRMH,LRSH)):24,1:20)
11 I J'>LRSHD W !! W:$D(LRCALE(LRMH,LRSH)) "Locale " W LRTOPP,?LRCL
12 F I=J:1:LRSHD I $D(I(I)) S Z=^LAB(64.5,1,1,LRMH,1,LRSH,1,I(I),0),LRCW=$P(Z,U,2) Q:(IOM-LRCL)<LRCW S LRCL=LRCL+LRCW,A=$L($P(Z,U,3))\2,B=LRCW\2 W $J($E($P(Z,U,3),1,(LRCW-1)),(A+B)),?LRCL
13 S LRJS=(I-1) S:LRACT=LRPL LRJS=LRJS+1
14 F I=J:1:LRJS I $D(I(I)) Q:'$D(^LAB(64.5,"A",1,LRMH,LRSH,I(I))) S Z=^(I(I)) S:$L($P(Z,U,2))!$L($P(Z,U,11)) LRFALT=1
15 S LRCL=$S($D(LRCALE(LRMH,LRSH)):24,1:20)
16 I LRFALT W ! W:$D(LRCALE(LRMH,LRSH)) ?8 W $S($L($P(^LAB(64.5,"A",1,LRMH,LRSH,I(J)),U,11)):"Therapeutic",1:"Ref range"),?LRCL D TS1
17 F I=J:1:LRJS I $D(I(I)) Q:'$D(^LAB(64.5,"A",1,LRMH,LRSH,I(I))) S:$L($P(^(I(I)),U,7)) LRFALT=1
18 I LRFALT S LRCL=$S($D(LRCALE(LRMH,LRSH)):24,1:20) W !?LRCL F I=J:1:LRJS I $D(I(I)) D TS2
19 S LRFALT=0 D DASH^LRX
20LRFDT K A,B S:LRNP LRFFDT=LRFDT,LRNP=0 S LRFDT=$O(^LAC(LRXLR,LRDFN,1,LRMH,1,LRSH,1,LRFDT)) G:LRFDT<1 LOOP^LRAC3 S Z1=^(LRFDT,0)
21 S LRTLOC=$P(Z1,U,2),^TMP($J,"K",LRSH,LRFDT,0)=LRSH_U_$P(Z1,U,1)_U_$P(Z1,U,5) S:LRFDT>LRLFDT LRLFDT=LRFDT
22 I $D(DUZ("AG")),$L(DUZ("AG")),"ARMYAFN"[DUZ("AG"),LRDPF=2 D REG^LRAC9
23GOUT D QRS^LRAC9 I LRCTR>LRLNS&(LRACT'<LRPL) S LRFULL=1 D TXT1^LRAC9 G:$O(^LAC(LRXLR,LRDFN,1,LRMH,1,LRSH,1,LRLFDT))<1 LRSH^LRAC3 D HEAD1^LRAC6,HEAD^LRAC6,LRLNS^LRAC3 S LRFULL=0,LRFDT=LRLFDT G TS
24 I LRCTR>LRLNS&(LRACT<LRPL) S LRFDT=LRFFDT G TS
25 G LRFDT
Note: See TracBrowser for help on using the repository browser.