LRBLJL1 ;AVAMC/REG/CYM - UNIT RELOCATION ; 12/18/00 1:49pm ;;5.2;LAB SERVICE;**72,79,90,247,267**;Sep 27, 1994 ;Per VHA Directive 97-033 this routine should not be modified. Medical Device # BK970021 ; ; Reference to ^SC( supported by DBIA908 ; S X="N",%DT="T" D ^%DT S H=Y,(A,LR("Q"),C)=0 F C(1)=0:0 S C=$O(^LRD(65,"AP",LRDFN,C)) Q:'C D L S (A,F)=0 F B=0:0 S A=$O(^TMP($J,"B",A)) Q:A="" D . F C=0:0 S C=$O(^TMP($J,"B",A,C)) Q:'C D .. F E=0:0 S E=$O(^TMP($J,"B",A,C,E)) Q:'E D ... S F=F+1,^TMP($J,"C",A,F)=^TMP($J,"B",A,C,E) K ^TMP($J,"B") S (B,F)=0 F A=1:1 S B=$O(^TMP($J,"C",B)) Q:B=""!(LR("Q")) D . W:A>1 ! F C=0:0 S C=$O(^TMP($J,"C",B,C)) Q:'C!(LR("Q")) S LRX=^(C) D S K ^TMP($J,"C") Q ; L I $D(^LRD(65,C,4)),$P(^(4),"^")]"" K ^LRD(65,"AP",LRDFN,C) Q S X=^LRD(65,C,0) Q:DUZ(2)'=$P(X,U,16) S (T,Y)=$P(X,U,6),L=+$O(^(3,0)),LRG=$G(^(L,0)),L=$S($P(LRG,U,4)]"":$P(LRG,U,4),1:"Blood Bank"),LRG=$P(LRG,U,2) ; The following 2 lines searches ALL previous relocation ; episodes to see if there have been any previous inspections ; of Unsatisfactory. N LRDT F LRDT=0:0 S LRDT=$O(^LRD(65,C,3,LRDT)) Q:LRDT'>0 D . I $D(^LRD(65,C,3,LRDT,0)) S:$P(^(0),U,2)="U" LRG(C)="U" S:T'["." T=T+.99 S M=^LAB(66,$P(X,U,4),0),Z=$P(M,U,26),Z=$S($P(M,U,19):1,'Z:"?",1:Z) S LR(65.01)=$P($G(^LRD(65,C,2,LRDFN,0)),"^",2) S A=A+1,^TMP($J,"B",Z,Y,A)=C_"^"_$P(X,"^")_"^"_$E($P(M,"^"),1,19)_"^"_$P(X,"^",7)_" "_$P(X,"^",8)_"^"_Y_"^"_L_"^"_$S(T1 S Y=-1 W $C(7),!!,"There can only be one entry in the HOSPITAL LOCATION file",!,"containing 'BLOOD BANK' in the name for ",LRAA(4) F A=0:0 S A=$O(C(A)) Q:'A W !?3,C(A) K A,B,C Q