LRMITSRH ;VA/SLC/STAFF - MICRO TREND REPORT HEADER ;JUL 06, 2010 3:14 PM
;;5.2;LAB SERVICE;**257,339,1027**;NOV 01, 1997
; from LRMITSR
; writes heading information
;
I $$S^%ZTLOAD S (LREND,ZTSTOP)=1 Q
W @IOF S LRPAGE=LRPAGE+1
S LRHDRT=$S(LRTYPE="O":"ORGANISM",LRTYPE="S":"SITE/SPECIMEN",LRTYPE="L":"LOCATION",LRTYPE="P":"PATIENT",LRTYPE="C":"COLLECTION SAMPLE",LRTYPE="DIV":"DIVISION",1:"PHYSICIAN")
I LRPAGE=1 D
.S LRLINE(1)=LRLINE1_LRHDRT,LRLINE(1)=$J(LRLINE(1),IOM+$L(LRLINE(1))\2)
.W LRLINE(1),!,LRLINE(2)
.I $D(LRM(LRTYPE,"S")) D
..W !,"This report is restricted to the following ",$$LOW^XLFSTR(LRHDRT),"s:"
..K LRTEMP D HLIST^LRMITSRS("LRM(LRTYPE,""S"")","LRTEMP",", ",IOM)
..S LRN="" F S LRN=$O(LRTEMP(LRN)) Q:LRN="" W !,LRTEMP(LRN)
..K LRTEMP
.S LRCNT=2 F S LRCNT=$O(LRLINE(LRCNT)) Q:LRCNT<1 W !,LRLINE(LRCNT)
S LRHDR(1)=LRHDR1_LRPATNUM_" patients) BY "_LRHDRT_" Page "_$J(LRPAGE,1)
S LRCNT=0 F S LRCNT=$O(LRHDR(LRCNT)) Q:LRCNT<1 W !,LRHDR(LRCNT)
Q
LRMITSRH ;VA/SLC/STAFF - MICRO TREND REPORT HEADER ;JUL 06, 2010 3:14 PM
+1 ;;5.2;LAB SERVICE;**257,339,1027**;NOV 01, 1997
+2 ; from LRMITSR
+3 ; writes heading information
+4 ;
+5 IF $$S^%ZTLOAD
SET (LREND,ZTSTOP)=1
QUIT
+6 WRITE @IOF
SET LRPAGE=LRPAGE+1
+7 SET LRHDRT=$SELECT(LRTYPE="O":"ORGANISM",LRTYPE="S":"SITE/SPECIMEN",LRTYPE="L":"LOCATION",LRTYPE="P":"PATIENT",LRTYPE="C":"COLLECTION SAMPLE",LRTYPE="DIV":"DIVISION",1:"PHYSICIAN")
+8 IF LRPAGE=1
Begin DoDot:1
+9 SET LRLINE(1)=LRLINE1_LRHDRT
SET LRLINE(1)=$JUSTIFY(LRLINE(1),IOM+$LENGTH(LRLINE(1))\2)
+10 WRITE LRLINE(1),!,LRLINE(2)
+11 IF $DATA(LRM(LRTYPE,"S"))
Begin DoDot:2
+12 WRITE !,"This report is restricted to the following ",$$LOW^XLFSTR(LRHDRT),"s:"
+13 KILL LRTEMP
DO HLIST^LRMITSRS("LRM(LRTYPE,""S"")","LRTEMP",", ",IOM)
+14 SET LRN=""
FOR
SET LRN=$ORDER(LRTEMP(LRN))
IF LRN=""
QUIT
WRITE !,LRTEMP(LRN)
+15 KILL LRTEMP
End DoDot:2
+16 SET LRCNT=2
FOR
SET LRCNT=$ORDER(LRLINE(LRCNT))
IF LRCNT<1
QUIT
WRITE !,LRLINE(LRCNT)
End DoDot:1
+17 SET LRHDR(1)=LRHDR1_LRPATNUM_" patients) BY "_LRHDRT_" Page "_$JUSTIFY(LRPAGE,1)
+18 SET LRCNT=0
FOR
SET LRCNT=$ORDER(LRHDR(LRCNT))
IF LRCNT<1
QUIT
WRITE !,LRHDR(LRCNT)
+19 QUIT