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

BLRLUAC7.m

Go to the documentation of this file.
BLRLUAC7 ;  IHS/OIT/MKK - IHS LRUPAC 7, file 4 & 60 report ; [ 05/15/11  7:50 AM ]
 ;;5.2;LR;**1030**;NOV 01, 1997
 ;;
 ;; Emulates the Lab accession and test counts Report, Part 5
 ;;
FILE4RPT ; EP - Institution File Counts
 NEW LRLDT,LRSDT,SELRAAAB,XTMPNODE
 NEW F4GTOT,LAB4IEN,L4DESC
 NEW BLRVERN,HEADER,LINES,MAXLINES,PG,QFLG,HEDONE
 ;
 Q:$$F4INITV()="Q"
 ;
 F  S LAB4IEN=$O(^BLRLUPAC(DATETIME,"SITESORT",LAB4IEN))  Q:LAB4IEN<1!(QFLG="Q")  D
 . I LINES>MAXLINES D HEADERPG^BLRGMENU(.PG,.QFLG,HEDONE)  Q:QFLG="Q"
 . ;
 . S L4DESC=$$TRIM^XLFSTR($P($G(^DIC(4,LAB4IEN,0)),"^"),"LR"," ")
 . W ?4,LAB4IEN
 . W ?14,L4DESC
 . W ?64,$J($FN($G(^BLRLUPAC(DATETIME,"SITESORT",LAB4IEN)),","),11)
 . W !
 . S LINES=LINES+1
 . S F4GTOT=F4GTOT+$G(^BLRLUPAC(DATETIME,"SITESORT",LAB4IEN))
 ;
 D TOTALS^BLRLUAC2(F4GTOT)
 ;
 D ^%ZISC
 ;
 Q:QFLG="Q"
 D PRESSKEY^BLRGMENU(9)
 ;
 Q
 ;
F4INITV() ; EP - File 4 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 Institution File Data Found."
 Q:$$GETXTMPV^BLRLUAC2("SITESORT",.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("Institution File (# 4) Sort",IOM)
 S HEADER(4)=$$CJ^XLFSTR(DATERNGE,IOM)
 ;
 S MAXLINES=22,LINES=MAXLINES+10,PG=0,(QFLG,HEDONE)="NO"
 ;
 D OPENIO^BLRLUAC9(.MAXLINES,.LINES)
 ;
 I IOST["C-VT" D HEADONE2^BLRLUAC2(.HEDONE)  W !
 ;
 S 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 (F4GTOT,LAB4IEN)=0
 ;
 Q "OK"
 ;
F460REPT ; EP
 NEW F4DESC,F4IEN,LAB60IEN,L60DESC
 NEW BLRVERN,HEADER,LINES,MAXLINES,PG,QFLG,HEDONE
 NEW LRLDT,LRSDT,SELRAAAB,XTMPNODE
 NEW F4GTOT,F4STOT,F60GTOT
 ;
 Q:$$F460INIV()="Q"
 ;
 F  S F4IEN=$O(^BLRLUPAC(DATETIME,"SITESORT",F4IEN))  Q:F4IEN<1!(QFLG="Q")  D
 . D F4LINE
 . F  S LAB60IEN=$O(^BLRLUPAC(DATETIME,"SITESORT",F4IEN,LAB60IEN))  Q:LAB60IEN<1!(QFLG="Q")  D
 .. D F460LINE
 . D F460SUB
 ;
 I QFLG="Q"  D ^%ZISC  Q
 ;
 D F460TOT
 ;
 D ^%ZISC
 ;
 D PRESSKEY^BLRGMENU(9)
 ;
 Q
 ;
F460INIV() ; 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 Institution 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("Institution (# 4) & Laboratory Test (# 60) Report",IOM)
 S HEADER(4)=$$CJ^XLFSTR(DATERNGE,IOM)
 ;
 S MAXLINES=22,LINES=MAXLINES+10,PG=0,(QFLG,HEDONE)="NO"
 ;
 D OPENIO^BLRLUAC9(.MAXLINES,.LINES)
 ;
 I IOST["C-VT" D HEADONE2^BLRLUAC2(.HEDONE)  W !
 ;
 S HEADER(5)=" "
 S HEADER(6)=$TR($$CJ^XLFSTR("@INSTITUTION@(File@4)@",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 (F4GTOT,F4STOT,F60GTOT,F4IEN)=0
 ;
 Q "OK"
 ;
F4LINE ; EP
 S F4DESC=$P($G(^DIC(4,F4IEN,0)),"^")
 I LINES<(MAXLINES+1) D JUSTSPEC
 I LINES>MAXLINES D F460PG  Q:QFLG="Q"
 S LAB60IEN=0
 Q
 ;
F460LINE ; EP 
 I LINES>MAXLINES&(HEDONE'="YES") D F460PG  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,"SITESORT",F4IEN,LAB60IEN)),7)
 W !
 ;
 S LINES=LINES+1
 S F60GTOT=F60GTOT+$G(^BLRLUPAC(DATETIME,"SITESORT",F4IEN,LAB60IEN))
 S F4STOT=F4STOT+$G(^BLRLUPAC(DATETIME,"SITESORT",F4IEN,LAB60IEN))
 Q
 ;
F460SUB ; EP - Subtotal
 W ?73,$TR($J("",7)," ","-"),!
 W ?9,F4DESC," TOTAL",?73,$J(F4STOT,7),!!
 S LINES=LINES+3
 S F4GTOT=F4GTOT+$G(^BLRLUPAC(DATETIME,"SITESORT",F4IEN))
 S F4STOT=0
 Q
 ;
F460TOT ; EP 
 ; W ?31,$TR($J("",7)," ","-")
 W ?73,$TR($J("",7)," ","-")
 W !
 W ?9,"TOTALS"
 ; W ?31,F4GTOT
 W ?73,$J(F60GTOT,7)
 W !
 Q
 ;
F460PG ; EP
 D HEADERPG^BLRGMENU(.PG,.QFLG,HEDONE)  Q:QFLG="Q"
 ;
JUSTSPEC ; EP
 W F4IEN
 W ?9,$E(F4DESC,1,18)
 ; W ?31,$G(^BLRLUPAC(DATETIME,"SITESORT",F4IEN))
 S:HEDONE="YES" PG=PG+1,LINES=7
 Q