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

LRMISEZB.m

Go to the documentation of this file.
LRMISEZB ;DALOI/REG/SLC/BA - MICROBIOLOGY INFECTION CONTROL DATA ;11/18/11  16:13
 ;;5.2;LAB SERVICE;**350**;Sep 27, 1994;Build 230
 ;
 ;from LRMISEZ1
 ;
START I $D(LRAP) D AP Q
 S LROR=0 F I=0:0 S LROR=$O(^LR(LRDFN,"MI",LRIDT,3,LROR)) Q:LROR<1  S LRBUG=+^(LROR,0),LRQUANT=$P(^(0),U,2),LRBUG=$S('$D(LRSGL):LRBUG,LRSGL=LRBUG:LRBUG,1:0) D:LRBUG SETUP
 Q
 ;
 ;
AP S LROR=0 F I=0:0 S LROR=$O(^LR(LRDFN,"MI",LRIDT,3,LROR)) Q:LROR<1  S LROK=1 D APCHK I LROK S LRBUG=+^LR(LRDFN,"MI",LRIDT,3,LROR,0),LRQUANT=$P(^(0),U,2),LRBUG=$S('$D(LRSGL):LRBUG,LRSGL=LRBUG:LRBUG,1:0) D:LRBUG SETUP
 Q
 ;
 ;
APCHK S LRBN=0 F I=0:0 S LRBN=$O(LRAP(LRBN)) Q:LRBN=""  S:'$D(^LR(LRDFN,"MI",LRIDT,3,LROR,LRBN)) LROK=0 Q:'LROK  I $L(^(LRBN)) S LROK=$S($L($P(^(LRBN),U,2)):$P(^(LRBN),U,2)=LRAP(LRBN),1:$P(^(LRBN),U)=LRAP(LRBN)) Q
 Q
 ;
 ;
SETUP S X=$P(^LAB(61.2,LRBUG,0),U,3),LRBUG=$S($L(X):$E(X,1),1:" ")_$E(^(0),1,2)_LRBUG,LRESULT=LRDAT_U_SSN_U_LRQUANT
 S:LRM("L")="A"!(LRM("L")="S"&(LRM("L","S")=LRLLOC)) ^TMP($J,"LOC",LRMY,LRLLOC,LRNAME,LRSIT,LRAC,LROR,LRBUG)=LRESULT
 I LRM("L")'="A"!(LRM("O")'="A") S:LRM("O")="A"!(LRM("O")="S"&(LRM("O","S")=+$E(LRBUG,4,25))) ^TMP($J,"ORG",LRMY,LRLLOC,LRNAME,LRSIT,LRAC,LROR,LRBUG)=LRESULT
 S:LRM("D")="A"!(LRM("D")="S"&(LRM("D","S")=LRDOC)) ^TMP($J,"DOC",LRMY,LRDOC,LRNAME,LRSIT,LRAC,LROR,LRBUG)=LRESULT
 S:LRM("P")="A"!(LRM("P")="S"&(LRM("P","S")=LRDFN)) ^TMP($J,"PAT",LRMY,LRNAME,LRNAME,LRSIT,LRAC,LROR,LRBUG)=LRESULT
 F S=2:0 S S=$O(^LR(LRDFN,"MI",LRIDT,3,LROR,S)) Q:S=""!(S'<3)  I $D(^LAB(62.06,"AI",S)),$L($P(^(S),U,2)) D BUG2A
 Q
 ;
 ;
BUG2A S R=^LR(LRDFN,"MI",LRIDT,3,LROR,S) Q:'$L($P(R,U))
 S LRESULT=$S($L($P(R,U,2)):$E($P(R,U,2)),1:$P(R,U)),LRDRUG=$P(^LAB(62.06,"AI",S),U)
 S:LRM("L")="A"!(LRM("L")="S"&(LRM("L","S")=LRLLOC)) ^TMP($J,"LOC",LRMY,LRLLOC,LRNAME,LRSIT,LRAC,LROR,LRBUG,LRDRUG)=LRESULT
 I LRM("L")'="A"!(LRM("O")'="A") S:LRM("O")="A"!(LRM("O")="S"&(LRM("O","S")=+$E(LRBUG,4,25))) ^TMP($J,"ORG",LRMY,LRLLOC,LRNAME,LRSIT,LRAC,LROR,LRBUG,LRDRUG)=LRESULT
 S:LRM("D")="A"!(LRM("D")="S"&(LRM("D","S")=LRDOC)) ^TMP($J,"DOC",LRMY,LRDOC,LRNAME,LRSIT,LRAC,LROR,LRBUG,LRDRUG)=LRESULT
 S:LRM("P")="A"!(LRM("P")="S"&(LRM("P","S")=LRDFN)) ^TMP($J,"PAT",LRMY,LRNAME,LRNAME,LRSIT,LRAC,LROR,LRBUG,LRDRUG)=LRESULT
 Q