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

LR7OSMZ1.m

Go to the documentation of this file.
LR7OSMZ1 ;DALOI/JMC - Silent Micro rpt Cont. ;Mar 05, 2019@13:04:42
 ;;5.2;LAB SERVICE;**121,244,350,520,536**;Sep 27, 1994;Build 18
 ;
EN ; from LRMINEW2, LRMIPC, LRMIPLOG, LR7OSMZ, LRMIVER1
 S LRSPEC=$P(LRLLT,U,5)
 I LRONESPC'="",LRSPEC'=LRONESPC Q
 ;
 N GIOM
 S GIOM=$G(LRGIOM)
 I GIOM="" D
 . S GIOM=$$GET^XPAR("USR^DIV^PKG","LR MI GUI REPORT RIGHT MARGIN",1,"Q")
 . I GIOM="" S GIOM=80
 ;
 D RPT
 K %,A8,A,AB,B,B1,B2,B3,C,IA,LR1PASS,LR2ORMOR,LRABCNT,LRACNT,LRAO,LRADM,LRADX,LRAFS,LRAMT,LRAX,LRBN,LRBRR,LRBUG,LRCOMTAB,LRCS,LRDCOM,LRDOC,LRDRTM1,LRDRTM2,LREF,LRFMT,LRGRM,LRIFN,LRINT,LRPATLOC,LRMYC,LRNS,LRNUM
 K LRORG,LRPAR,LRPC,LRPRE,LRPRINT,LRQU,LRRC,LRRES,LRSBC1,LRSBC2,LRSET,LRSIC1,LRSIC2,LRSPEC,LRSSD,LRST,LRTA,LRTB,LRTBA,LRTBC,LRTBS,LRTK,LRTS,LRTSTS,LRTUS,LRUS,LRWRD,N
 Q
 ;
 ;
RPT ;
 ;
 N J,LRTSTS,LRTS,LRTESTCOMPLE,LRX,LRY,LRDISP
 ;
 S:'$D(LRSB) LRSB=0
 S LRPRINT=$S($D(^LRO(68,LRAA,1,LRAD,1,LRAN,4)):"",1:1),LRPATLOC=$P(LRLLT,U,8)
 S LRCS=$S($D(^LAB(62,+$P(LRLLT,U,11),0)):$P(^(0),U),1:"")
 S LRTK=$P(LRLLT,U),LRRC=$P(LRLLT,U,10),LRST=$S(LRSPEC:$P(^LAB(61,LRSPEC,0),U),1:""),Y=LRTK
 D D^LRU
 S LRTK=Y,Y=LRRC
 D D^LRU
 S LRRC=Y,X=$P(LRLLT,U,7)
 D DOC^LRX
 ;
 K ^TMP("LR",$J,"T"),LRTSTS
 ;
 S (LRBRR,LRTESTCOMPLE)=0
 F  S LRBRR=+$O(^LRO(68,LRAA,1,LRAD,1,LRAN,4,LRBRR)) Q:LRBRR<1  D EN1
 I 'LRPRINT,LRONETST Q
 S LRPG=0
 D HDR^LR7OSMZU
 Q:LREND
 ;
 I $D(^TMP("LR",$J,"T")) D
 . D LINE^LR7OSUM4,LN
 . S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(2,CCNT,"Test(s) ordered:")
 . S J=""
 . F  S J=$O(^TMP("LR",$J,"T",J)) Q:J=""  S X=^(J) D
 . . S LRX=$P(X,"^")
 . . I LRTESTCOMPLE S LRX=$$LJ^XLFSTR(LRX,30,".")
 . . S ^(0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS(19,CCNT,LRX)
 . . S:'$D(^TMP("LRT",$J,$P(X,"^"))) ^($P(X,"^"))="MICROBIOLOGY"_"^"_GCNT
 . . I '$P(X,U,2) D LN S ^TMP("LRC",$J,GCNT,0)="" Q
 . . S Y=$P(X,U,2)
 . . ; LR*5.2*520 and LR*5.2*536
 . . S LRDISP=$P(X,U,3)
 . . D D^LRU S LRY=$S(LRDISP["Not Performed":"canceled: ",1:"completed: ")_Y
 . . I (19+$L(LRX)+$L(LRY))>GIOM D LN S ^TMP("LRC",$J,GCNT,0)=""
 . . S ^(0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS(50,CCNT,LRY)
 . . D LN S ^TMP("LRC",$J,GCNT,0)=""
 ;
 K ^TMP("LR",$J,"T"),LRTSTS
 ;
 I $D(^LR(LRDFN,"MI",LRIDT,14)) D ANTI^LR7OSMZ2,LINE^LR7OSUM4
 I $D(^LR(LRDFN,"MI",LRIDT,1)) D BACT^LR7OSMZ2,REFS^LR7OSMZU,LINE^LR7OSUM4
 I $D(^LR(LRDFN,"MI",LRIDT,31)) D STER^LR7OSMZ3,LINE^LR7OSUM4
 I $D(^LR(LRDFN,"MI",LRIDT,5)) D PARA^LR7OSMZ3,REFS^LR7OSMZU,LINE^LR7OSUM4
 I $D(^LR(LRDFN,"MI",LRIDT,16)) D VIR^LR7OSMZ3,REFS^LR7OSMZU,LINE^LR7OSUM4
 I $D(^LR(LRDFN,"MI",LRIDT,11)) D TB^LR7OSMZ4,REFS^LR7OSMZU,LINE^LR7OSUM4
 I $D(^LR(LRDFN,"MI",LRIDT,8)) D FUNG^LR7OSMZ4,REFS^LR7OSMZU,LINE^LR7OSUM4
 ;
 ; List performing labs
 D PPL(LRDFN,"MI",LRIDT)
 ;
 Q
 ;
 ;
EN1 ;
 ; LR*5.2*520 Set disposition to LRDISP
 S LRTS=+^LRO(68,LRAA,1,LRAD,1,LRAN,4,LRBRR,0),LRTS(1)=$P(^(0),U,5),LRDISP=$P(^(0),U,6)
 Q:'$L($P($G(^LAB(60,LRTS,0)),U,3))
 I '$D(LRLABKY),"BO"'[$P($G(^LAB(60,LRTS,0)),U,3) Q
 ;
 ; Set flag that at least one test is completed
 I LRTS(1) S LRTESTCOMPLE=1
 ;
 S:LRTS=LRONETST LRPRINT=1
 S LRTSTS=$S($D(^LAB(60,LRTS,0)):$P(^(0),U),1:"deleted test"),^TMP("LR",$J,"T",$S($D(^LAB(60,LRTS,.1)):$P(^(.1),U,6),1:"")_","_LRBRR)=LRTSTS_U_LRTS(1)_U_LRDISP
 Q
 ;
 ;
LN ;Increment counter
 S GCNT=GCNT+1,CCNT=1
 Q
 ;
 ;
PPL(LRDFN,LRSS,LRIDT) ; Print any performing laboratories
 ; Call with LRDFN = file #63 IEN
 ;            LRSS = File #63 subscript
 ;           LRIDT = file #63 specimen inverse date/time
 ;
 N LRPL,LRI,LRX
 ;
 D RETLST^LRRPL(.LRPL,LRDFN,LRSS,LRIDT,0)
 I $G(LRPL)<1 Q
 ;
 D LN S LRX="=--",^TMP("LRC",$J,GCNT,0)=$$REPEAT^XLFSTR(LRX,GIOM/$L(LRX))
 D LN S ^TMP("LRC",$J,GCNT,0)="Performing Laboratory:"
 ;
 S LRI=0
 F  S LRI=$O(LRPL(LRI)) Q:'LRI  D LN S ^TMP("LRC",$J,GCNT,0)=LRPL(LRI)
 D LN S ^TMP("LRC",$J,GCNT,0)=""
 ;
 Q