Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: BLRLUAC4

BLRLUAC4.m

Go to the documentation of this file.
BLRLUAC4 ; IHS/OIT/MKK - IHS LRUPAC 4, file 61 & 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 4
 ;;
F6160RPT ; EP
 NEW LAB60IEN,L60DESC,SPECTYPE,SPECNAME
 NEW BLRVERN,HEADER,LINES,MAXLINES,PG,QFLG,HEDONE
 NEW LRLDT,LRSDT,SELRAAAB,XTMPNODE
 NEW F60GTOT,F60STOT,F61GTOT,F61STOT
 ;
 Q:$$F6160INV()="Q"
 ;
 F  S SPECTYPE=$O(^BLRLUPAC(DATETIME,"SPECSORT",SPECTYPE))  Q:SPECTYPE<1!(QFLG="Q")  D
 . D SPECLINE
 . F  S LAB60IEN=$O(^BLRLUPAC(DATETIME,"SPECSORT",SPECTYPE,LAB60IEN))  Q:LAB60IEN<1!(QFLG="Q")  D
 .. D L60LINE
 . D SPECTOTL
 ;
 Q:QFLG="Q"
 ;
 D F6160TOT
 ;
 D CLOSEIO^BLRLUAC9
 ;
 D PRESSKEY^BLRGMENU(9)
 ;
 Q
 ;
F6160INV() ; EP - File 61 with File 60 detail 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 Topography nor Laboratory Test File Data Found."
 Q:$$GETXTMPV^BLRLUAC2("SPECSORT",.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("Topography (# 61) & Laboratory Test (# 60) Report",IOM)
 S HEADER(4)=$$CJ^XLFSTR(DATERNGE,IOM)
 ;
 S MAXLINES=22,LINES=MAXLINES+10,PG=0
 S QFLG="NO"
 ;
 S HEADER(5)=" "
 S HEADER(6)=$TR($$CJ^XLFSTR("@TOPOGRAPHY@(File@61)@",38)," @","= ")
 S $E(HEADER(6),42)=$TR($$CJ^XLFSTR("@LABORATORY@TEST@(File@60)@",39)," @","= ")
 S HEADER(7)="IEN"
 S $E(HEADER(7),10)="Description"
 ; S $E(HEADER(7),32)="Count"
 S $E(HEADER(7),42)="IEN"
 S $E(HEADER(7),52)="Description"
 S $E(HEADER(7),74)="Count"
 ;
 S (F60GTOT,F61GTOT,F61STOT,SPECTYPE)=0
 ;
 S (HEDONE,QFLG)="NO"
 S MAXLINES=22,LINES=MAXLINES+10,PG=0
 ;
 D OPENIO^BLRLUAC9(.MAXLINES,.LINES)
 ;
 I IOST["C-VT" D HEADONE2^BLRLUAC2(.HEDONE)  W !
 ;
 Q "OK"
 ;
SPECLINE ; EP
 S SPECNAME=$P($G(^LAB(61,SPECTYPE,0)),"^")
 I LINES<(MAXLINES+1) D JUSTSPEC
 I LINES>MAXLINES D F6160PG  Q:QFLG="Q"
 S (F60STOT,LAB60IEN)=0
 Q
 ;
L60LINE ; EP
 I LINES>MAXLINES&(HEDONE'="YES") D F6160PG  Q:QFLG="Q"
 ;
 S L60DESC=$$TRIM^XLFSTR($P($G(^LAB(60,LAB60IEN,0)),"^"),"LR"," ")
 ;
 W ?41,LAB60IEN
 W ?51,$E(L60DESC,1,18)
 W ?73,$J($G(^BLRLUPAC(DATETIME,"SPECSORT",SPECTYPE,LAB60IEN)),7)
 W !
 ;
 S LINES=LINES+1
 S F60GTOT=F60GTOT+$G(^BLRLUPAC(DATETIME,"SPECSORT",SPECTYPE,LAB60IEN))
 S F60STOT=F60STOT+$G(^BLRLUPAC(DATETIME,"SPECSORT",SPECTYPE,LAB60IEN))
 Q
 ;
SPECTOTL ; EP
 D:LINES+3>MAXLINES HEADERPG^BLRGMENU(.PG,.QFLG,HEDONE)  Q:QFLG="Q"
 ;
 W ?73,$TR($J("",7)," ","-")
 W !
 ;
 W SPECTYPE
 W ?9,SPECNAME," TOTALS"
 W ?73,$J(F60STOT,7)
 W !!
 S LINES=LINES+3
 ;
 S F61GTOT=F61GTOT+$G(^BLRLUPAC(DATETIME,"SPECSORT",SPECTYPE))
 S (F61STOT,F60STOT)=0
 Q
 ;
F6160TOT ; EP
 W ?73,$TR($J("",7)," ","-")
 W !
 W ?9,"TOPOGRAPHY (File 61) Totals"
 W ?73,$J(F60GTOT,7)
 W !
 S LINES=LINES+2
 Q
 ;
F6160PG ; EP
 D HEADERPG^BLRGMENU(.PG,.QFLG,HEDONE)  Q:QFLG="Q"
 ;
JUSTSPEC ; EP
 W SPECTYPE
 W ?9,$E(SPECNAME,1,25)
 ; W ?31,$J($G(^BLRLUPAC(DATETIME,"SPECSORT",SPECTYPE)),7)
 S:HEDONE="YES" PG=PG+1,LINES=7
 Q