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

BLRALBM.m

Go to the documentation of this file.
BLRALBM ;DAOU/ALA-Build Micro result [ 11/18/2002  1:33 PM ]
 ;;5.2;LR;**1013,1015**;NOV 18, 2002
 ;
EN ;
 S LRPATLOC=$S($D(LRLLOC):LRLLOC,1:""),LRLOC=LRPATLOC
 S LRONETST="",LRONESPC="",LREND=0 D ^LRPARAM
 S LRLLT=$G(^LR(LRDFN,"MI",LRIDT,0)),LRACC=$P(LRLLT,U,6)
 S LRAD=$E(LRLLT)_$P(LRACC," ",2)_"0000",X=$P(LRACC," "),DIC=68,DIC(0)="M"
 Q:'$L(X)
 D ^DIC S LRAA=+Y,LRAN=+$P(LRACC," ",3),LRCMNT=$G(^LR(LRDFN,"MI",LRIDT,99)),LRPG=0
 I '$D(LRONESPC) S LRONESPC="",DIC="^LAB(61,",DIC("A")="Select SPECIMEN/SOURCE: ANY//",DIC(0)="AEMOQ" D ^DIC S:Y>0 LRONESPC=+Y K DIC("A")
 I '$D(LRONETST) S LRONETST="",DIC="^LAB(60,",DIC(0)="AEOQ",DIC("S")="I $P(^(0),U,4)=""MI"")"_$S('$D(LRLABKY):",""BO""[$P(^(0),U,3)",1:""),D="E" D IX^DIC Q:Y<1  I Y>0 S LRONETST=+Y
 S LRSPEC=$P(LRLLT,U,5) I LRONESPC'="",LRSPEC'=LRONESPC Q
 D RPT
 K %,A8,A,AB,B,B1,B2,B3,C,IA,LR1PASS,LR2ORMOR,LRABCNT,LRACNT,LRADM
 K LRADX,LRAFS,LRAMT,LRAX,LRBN,LRBRR,LRBUG,LRCOMTAB,LRCS,LRDCOM,LRDOC
 K LRDRTM1,LRDRTM2,LREF,LRFLIP,LRFMT,LRGRM,LRHC,LRIFN,LRINT,LRPATLOC
 K LRMYC,LRNS,LRNUM,LRORG,LRPAR,LRPC,LRPRE,LRPRINT,LRQU,LRRC,LRRES
 K LRSBC1,LRSBC2,LRSET,LRSIC1,LRSIC2,LRSPEC,LRSSD,LRST,LRTA,LRTB,LRTBA
 K LRTBC,LRTBS,LRTK,LRTS,LRTSTS,LRTUS,LRUS,LRWRD,N
 Q
RPT S:'$D(LRSB) LRSB=0
 S LRPRINT=$S($D(^LRO(68,LRAA,1,LRAD,1,LRAN,4)):"",1:1)
 S LRHC=$S($E(IOST,1,2)'="C-":1,1:0),LRFLIP=$S(LRHC:11,1:6)
 I $D(DUZ("AG")),$L(DUZ("AG")),"ARMYAFN"[DUZ("AG"),LRDPF=2 S LRFDT=9999999-LRIDT D REG^LRAC9 K LRFDT
 K DIC D DT^LRX
 S LRDPF=$P($G(^LR(LRDFN,0)),U,2),DFN=$P($G(^(0)),U,3) D PT^LRX
 S:$G(VAIN(3)) DOB=$P(VAIN(3),U,2) S LRPATLOC=$P(LRLLT,U,8)
 S (LRADM,LRADX)="" I +$G(LRDPF)=2,'$G(VAERR) D
 . S LRADM=$S($L(VAIN(7)):$P(VAIN(7),U,2),1:"")
 . S LRADX=$S($L(VAIN(9)):VAIN(9),1:"")
 S LRCS=$P($G(^LAB(62,+$P(LRLLT,U,11),0)),U,1)
 S LRTK=$P(LRLLT,U),LRRC=$P(LRLLT,U,10)
 S LRST=$S(LRSPEC:$P($G(^LAB(61,LRSPEC,0)),U),1:""),Y=LRTK D D^LRU
 S LRTK=Y,Y=LRRC D D^LRU S LRRC=Y
 S X=$P(LRLLT,U,7) D DOC^LRX
 K ^TMP("LR",$J,"T"),LRTSTS
 S LRBRR=0 F  S LRBRR=+$O(^LRO(68,LRAA,1,LRAD,1,LRAN,4,LRBRR)) Q:LRBRR<1  D EN1
 I 'LRPRINT,LRONETST Q
 ;
 D HDR
 D LIN^BLRALBA
 ;
 I $D(^TMP("LR",$J,"T")) D
 . S BLRAZ=$E(BLRABLKS,1,5)_"Test(s) ordered:"
 . S J="" F  S J=$O(^TMP("LR",$J,"T",J)) Q:J=""  S X=^(J) D
 .. S BLRAZ1=23 D Z1
 .. S BLRAZ=BLRAZ_$P(X,U) S Y=$P(X,U,2) D:$L(Y) D^LRU
 .. I $L(Y) S BLRAZ1=43 D Z1 S BLRAZ=BLRAZ_" completed: "_Y
 .. S BLRADSP=BLRADSP+1,^TMP($J,"BLRA",BLRADSP,0)=BLRAZ,BLRAZ=""
 K ^TMP("LR",$J,"T"),LRTSTS
 I $D(^LR(LRDFN,"MI",LRIDT,14)) D ANTI^BLRALBM1
 I $D(^LR(LRDFN,"MI",LRIDT,1)) D BACT^BLRALBM1,REFS
 I $D(^LR(LRDFN,"MI",LRIDT,31)) D STER^BLRALBM2
 I $D(^LR(LRDFN,"MI",LRIDT,5)) D PARA^BLRALBM2,REFS
 I $D(^LR(LRDFN,"MI",LRIDT,16)) D VIR^BLRALBM2,REFS
 I $D(^LR(LRDFN,"MI",LRIDT,11)) D TB^BLRALBM3,REFS
 I $D(^LR(LRDFN,"MI",LRIDT,8)) D FUNG^BLRALBM3,REFS
 Q
 ;
EN1 S LRTS=+$G(^LRO(68,LRAA,1,LRAD,1,LRAN,4,LRBRR,0)),LRTS(1)=$P($G(^(0)),U,5)
 Q:'$L($P($G(^LAB(60,LRTS,0)),U,3))  I '$D(LRLABKY),"BO"'[$P($G(^LAB(60,LRTS,0)),U,3) Q
 S:LRTS=LRONETST LRPRINT=1 S LRTSTS=$S($D(^LAB(60,LRTS,0)):$P($G(^(0)),U),1:"deleted test"),^TMP("LR",$J,"T",$S($D(^LAB(60,LRTS,.1)):$P($G(^(.1)),U,6),1:"")_","_LRBRR)=LRTSTS_U_LRTS(1)
 Q
 ;
REFS ;
 S B=1,LREF=0
 F  S LREF=$O(LRBUG(LREF)) Q:LREF=""  S LRIFN=LRBUG(LREF) D LIST
 K LRBUG
 Q
LIST Q:'$D(^LAB(61.2,LRIFN,"JR",0))
 S LRNUM=0
 F  S LRNUM=$O(^LAB(61.2,LRIFN,"JR",LRNUM)) Q:LRNUM=""  D WR
 Q
WR S X1=$G(^LAB(61.2,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IV
 ;I '$D(LRH),LRHC W !?32,$S($D(^XUSEC("LRLAB",DUZ))&'$D(LRWRDVEW):"LAB",1:"CHART")," COPY"
 S BLRAZ="Accession: "_LRACC,BLRAZ1=40 D Z1
 S BLRAZ=BLRAZ_"Received: "_LRRC
 S BLRADSP=BLRADSP+1,^TMP($J,"BLRA",BLRADSP,0)=BLRAZ
 S BLRAZ="Collection sample: "_LRCS,BLRAZ1=40 D Z1
 S BLRAZ=BLRAZ_"Collection date: "_LRTK
 S BLRADSP=BLRADSP+1,^TMP($J,"BLRA",BLRADSP,0)=BLRAZ
 I LRCS'=LRST D
 . S BLRAZ="Site/Specimen: "_LRST
 . S BLRADSP=BLRADSP+1,^TMP($J,"BLRA",BLRADSP,0)=BLRAZ
 S BLRAZ="Provider: "_LRDOC
 S BLRADSP=BLRADSP+1,^TMP($J,"BLRA",BLRADSP,0)=BLRAZ
 I $L(LRCMNT) D
 . S BLRAZ="Comment on specimen: "_LRCMNT
 . S BLRADSP=BLRADSP+1,^TMP($J,"BLRA",BLRADSP,0)=BLRAZ
 Q