BLRLUAC5 ; IHS/OIT/MKK - IHS LRUPAC 5, file 60 report ; [ 05/15/11 7:50 AM ]
;;5.2;IHS LABORATORY;**1030**;NOV 01, 1997
;;
;; Emulates the Lab accession and test counts Report, Part 5
;;
F60SREPT ; EP - File 60 (Laboratory Test) Sorted Report
NEW LRLDT,LRSDT,SELRAAAB,XTMPNODE
NEW F60GTOT,LAB60IEN,L60DESC
NEW BLRVERN,HEADER,LINES,MAXLINES,PG,QFLG,HEDONE
;
Q:$$F60INITV()="Q"
;
F S LAB60IEN=$O(^BLRLUPAC(DATETIME,"TESTSORT",LAB60IEN)) Q:LAB60IEN<1!(QFLG="Q") D
. I LINES>MAXLINES D HEADERPG^BLRGMENU(.PG,.QFLG,HEDONE) Q:QFLG="Q"
. ;
. S L60DESC=$$TRIM^XLFSTR($P($G(^LAB(60,LAB60IEN,0)),"^"),"LR"," ")
. W ?4,LAB60IEN
. W ?14,L60DESC
. W ?64,$J($FN($G(^BLRLUPAC(DATETIME,"TESTSORT",LAB60IEN)),","),11)
. W !
. S LINES=LINES+1
. S F60GTOT=F60GTOT+$G(^BLRLUPAC(DATETIME,"TESTSORT",LAB60IEN))
;
D TOTALS^BLRLUAC2(F60GTOT)
D CLOSEIO^BLRLUAC9
;
Q:QFLG="Q"
D PRESSKEY^BLRGMENU(9)
;
Q
;
F60INITV() ; EP - File 60 report INITialization of Variables
D SETXTMPN^BLRLUAC1(.XTMPNODE) ; Set the ^TMP node
S BLRVERN=$P($P($T(+1),";")," ")
;
NEW DATERNGE,BADMSG,STR
;
S BADMSG="No Laboratory Test File Data Found."
Q:$$GETXTMPV^BLRLUAC2("TESTSORT",.SELRAAAB,.LRSDT,.LRLDT,BADMSG)="Q" "Q"
;
S DATERNGE="Date Range: "_$$FMTE^XLFDT(LRSDT,"5DZ")
S DATERNGE=DATERNGE_" thru "_$$FMTE^XLFDT(LRLDT,"5DZ")
;
K HEADER
S HEADER(1)="Lab Accession and Test Counts"
S HEADER(2)=SELRAAAB_" Accession Area Counts Only"
S HEADER(3)=$$CJ^XLFSTR("Laboratory Test File (# 60) Sort",IOM)
S HEADER(4)=$$CJ^XLFSTR(DATERNGE,IOM)
;
S MAXLINES=21,LINES=MAXLINES+10,PG=0,(HEDONE,QFLG)="NO"
;
S HEADER(5)=" "
S $E(HEADER(6),5)="IEN"
S $E(HEADER(6),15)="Description"
S $E(HEADER(6),65)=$J("Count",11)
;
S (F60GTOT,LAB60IEN)=0
;
D OPENIO^BLRLUAC9(.MAXLINES,.LINES)
;
I IOST["C-VT" D HEADONE2^BLRLUAC2(.HEDONE) W !
;
Q "OK"
;
F44REPT ; EP - Location File Counts
NEW LRLDT,LRSDT,SELRAAAB,XTMPNODE
NEW F44GTOT,LAB44IEN,L44DESC
NEW BLRVERN,HEADER,LINES,MAXLINES,PG,QFLG,HEDONE
;
Q:$$F44INITV()="Q"
;
F S LAB44IEN=$O(^BLRLUPAC(DATETIME,"LOCSORT",LAB44IEN)) Q:LAB44IEN<1!(QFLG="Q") D
. I LINES>MAXLINES D HEADERPG^BLRGMENU(.PG,.QFLG,HEDONE) Q:QFLG="Q"
. ;
. S L44DESC=$$TRIM^XLFSTR($P($G(^SC(LAB44IEN,0)),"^"),"LR"," ")
. W ?4,LAB44IEN
. W ?14,L44DESC
. W ?64,$J($FN($G(^BLRLUPAC(DATETIME,"LOCSORT",LAB44IEN)),","),11)
. W !
. S LINES=LINES+1
. S F44GTOT=F44GTOT+$G(^BLRLUPAC(DATETIME,"LOCSORT",LAB44IEN))
;
D TOTALS^BLRLUAC2(F44GTOT)
D CLOSEIO^BLRLUAC9
;
Q:QFLG="Q"
D PRESSKEY^BLRGMENU(9)
;
Q
;
F44INITV() ; EP - File 44 report INITialization of Variables
D SETXTMPN^BLRLUAC1(.XTMPNODE) ; Set the ^TMP node
S BLRVERN=$P($P($T(+1),";")," ")
;
NEW DATERNGE,BADMSG,STR
;
S BADMSG="No Hospital Location File Data Found."
Q:$$GETXTMPV^BLRLUAC2("LOCSORT",.SELRAAAB,.LRSDT,.LRLDT,BADMSG)="Q" "Q"
;
S DATERNGE="Date Range: "_$$FMTE^XLFDT(LRSDT,"5DZ")
S DATERNGE=DATERNGE_" thru "_$$FMTE^XLFDT(LRLDT,"5DZ")
;
K HEADER
S HEADER(1)="Lab Accession and Test Counts"
S HEADER(2)=SELRAAAB_" Accession Area Counts Only"
S HEADER(3)=$$CJ^XLFSTR("Hospital Location File (# 44) Sort",IOM)
S HEADER(4)=$$CJ^XLFSTR(DATERNGE,IOM)
;
S MAXLINES=22,LINES=MAXLINES+10,PG=0,(QFLG,HEDONE)="NO"
;
S HEADER(5)=" "
S $E(HEADER(6),5)="IEN"
S $E(HEADER(6),15)="Description"
S $E(HEADER(6),65)=$J("Count",11)
;
S (F44GTOT,LAB44IEN)=0
;
D OPENIO^BLRLUAC9(.MAXLINES,.LINES)
;
I IOST["C-VT" D HEADONE2^BLRLUAC2(.HEDONE) W !
;
Q "OK"
BLRLUAC5 ; IHS/OIT/MKK - IHS LRUPAC 5, file 60 report ; [ 05/15/11 7:50 AM ]
+1 ;;5.2;IHS LABORATORY;**1030**;NOV 01, 1997
+2 ;;
+3 ;; Emulates the Lab accession and test counts Report, Part 5
+4 ;;
F60SREPT ; EP - File 60 (Laboratory Test) Sorted Report
+1 NEW LRLDT,LRSDT,SELRAAAB,XTMPNODE
+2 NEW F60GTOT,LAB60IEN,L60DESC
+3 NEW BLRVERN,HEADER,LINES,MAXLINES,PG,QFLG,HEDONE
+4 ;
+5 IF $$F60INITV()="Q"
QUIT
+6 ;
+7 FOR
SET LAB60IEN=$ORDER(^BLRLUPAC(DATETIME,"TESTSORT",LAB60IEN))
IF LAB60IEN<1!(QFLG="Q")
QUIT
Begin DoDot:1
+8 IF LINES>MAXLINES
DO HEADERPG^BLRGMENU(.PG,.QFLG,HEDONE)
IF QFLG="Q"
QUIT
+9 ;
+10 SET L60DESC=$$TRIM^XLFSTR($PIECE($GET(^LAB(60,LAB60IEN,0)),"^"),"LR"," ")
+11 WRITE ?4,LAB60IEN
+12 WRITE ?14,L60DESC
+13 WRITE ?64,$JUSTIFY($FNUMBER($GET(^BLRLUPAC(DATETIME,"TESTSORT",LAB60IEN)),","),11)
+14 WRITE !
+15 SET LINES=LINES+1
+16 SET F60GTOT=F60GTOT+$GET(^BLRLUPAC(DATETIME,"TESTSORT",LAB60IEN))
End DoDot:1
+17 ;
+18 DO TOTALS^BLRLUAC2(F60GTOT)
+19 DO CLOSEIO^BLRLUAC9
+20 ;
+21 IF QFLG="Q"
QUIT
+22 DO PRESSKEY^BLRGMENU(9)
+23 ;
+24 QUIT
+25 ;
F60INITV() ; EP - File 60 report INITialization of Variables
+1 ; Set the ^TMP node
DO SETXTMPN^BLRLUAC1(.XTMPNODE)
+2 SET BLRVERN=$PIECE($PIECE($TEXT(+1),";")," ")
+3 ;
+4 NEW DATERNGE,BADMSG,STR
+5 ;
+6 SET BADMSG="No Laboratory Test File Data Found."
+7 IF $$GETXTMPV^BLRLUAC2("TESTSORT",.SELRAAAB,.LRSDT,.LRLDT,BADMSG)="Q"
QUIT "Q"
+8 ;
+9 SET DATERNGE="Date Range: "_$$FMTE^XLFDT(LRSDT,"5DZ")
+10 SET DATERNGE=DATERNGE_" thru "_$$FMTE^XLFDT(LRLDT,"5DZ")
+11 ;
+12 KILL HEADER
+13 SET HEADER(1)="Lab Accession and Test Counts"
+14 SET HEADER(2)=SELRAAAB_" Accession Area Counts Only"
+15 SET HEADER(3)=$$CJ^XLFSTR("Laboratory Test File (# 60) Sort",IOM)
+16 SET HEADER(4)=$$CJ^XLFSTR(DATERNGE,IOM)
+17 ;
+18 SET MAXLINES=21
SET LINES=MAXLINES+10
SET PG=0
SET (HEDONE,QFLG)="NO"
+19 ;
+20 SET HEADER(5)=" "
+21 SET $EXTRACT(HEADER(6),5)="IEN"
+22 SET $EXTRACT(HEADER(6),15)="Description"
+23 SET $EXTRACT(HEADER(6),65)=$JUSTIFY("Count",11)
+24 ;
+25 SET (F60GTOT,LAB60IEN)=0
+26 ;
+27 DO OPENIO^BLRLUAC9(.MAXLINES,.LINES)
+28 ;
+29 IF IOST["C-VT"
DO HEADONE2^BLRLUAC2(.HEDONE)
WRITE !
+30 ;
+31 QUIT "OK"
+32 ;
F44REPT ; EP - Location File Counts
+1 NEW LRLDT,LRSDT,SELRAAAB,XTMPNODE
+2 NEW F44GTOT,LAB44IEN,L44DESC
+3 NEW BLRVERN,HEADER,LINES,MAXLINES,PG,QFLG,HEDONE
+4 ;
+5 IF $$F44INITV()="Q"
QUIT
+6 ;
+7 FOR
SET LAB44IEN=$ORDER(^BLRLUPAC(DATETIME,"LOCSORT",LAB44IEN))
IF LAB44IEN<1!(QFLG="Q")
QUIT
Begin DoDot:1
+8 IF LINES>MAXLINES
DO HEADERPG^BLRGMENU(.PG,.QFLG,HEDONE)
IF QFLG="Q"
QUIT
+9 ;
+10 SET L44DESC=$$TRIM^XLFSTR($PIECE($GET(^SC(LAB44IEN,0)),"^"),"LR"," ")
+11 WRITE ?4,LAB44IEN
+12 WRITE ?14,L44DESC
+13 WRITE ?64,$JUSTIFY($FNUMBER($GET(^BLRLUPAC(DATETIME,"LOCSORT",LAB44IEN)),","),11)
+14 WRITE !
+15 SET LINES=LINES+1
+16 SET F44GTOT=F44GTOT+$GET(^BLRLUPAC(DATETIME,"LOCSORT",LAB44IEN))
End DoDot:1
+17 ;
+18 DO TOTALS^BLRLUAC2(F44GTOT)
+19 DO CLOSEIO^BLRLUAC9
+20 ;
+21 IF QFLG="Q"
QUIT
+22 DO PRESSKEY^BLRGMENU(9)
+23 ;
+24 QUIT
+25 ;
F44INITV() ; EP - File 44 report INITialization of Variables
+1 ; Set the ^TMP node
DO SETXTMPN^BLRLUAC1(.XTMPNODE)
+2 SET BLRVERN=$PIECE($PIECE($TEXT(+1),";")," ")
+3 ;
+4 NEW DATERNGE,BADMSG,STR
+5 ;
+6 SET BADMSG="No Hospital Location File Data Found."
+7 IF $$GETXTMPV^BLRLUAC2("LOCSORT",.SELRAAAB,.LRSDT,.LRLDT,BADMSG)="Q"
QUIT "Q"
+8 ;
+9 SET DATERNGE="Date Range: "_$$FMTE^XLFDT(LRSDT,"5DZ")
+10 SET DATERNGE=DATERNGE_" thru "_$$FMTE^XLFDT(LRLDT,"5DZ")
+11 ;
+12 KILL HEADER
+13 SET HEADER(1)="Lab Accession and Test Counts"
+14 SET HEADER(2)=SELRAAAB_" Accession Area Counts Only"
+15 SET HEADER(3)=$$CJ^XLFSTR("Hospital Location File (# 44) Sort",IOM)
+16 SET HEADER(4)=$$CJ^XLFSTR(DATERNGE,IOM)
+17 ;
+18 SET MAXLINES=22
SET LINES=MAXLINES+10
SET PG=0
SET (QFLG,HEDONE)="NO"
+19 ;
+20 SET HEADER(5)=" "
+21 SET $EXTRACT(HEADER(6),5)="IEN"
+22 SET $EXTRACT(HEADER(6),15)="Description"
+23 SET $EXTRACT(HEADER(6),65)=$JUSTIFY("Count",11)
+24 ;
+25 SET (F44GTOT,LAB44IEN)=0
+26 ;
+27 DO OPENIO^BLRLUAC9(.MAXLINES,.LINES)
+28 ;
+29 IF IOST["C-VT"
DO HEADONE2^BLRLUAC2(.HEDONE)
WRITE !
+30 ;
+31 QUIT "OK"