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

LAMIAUT8.m

Go to the documentation of this file.
LAMIAUT8 ;FHS/SLC - ADD OR DELETE FROM VITEK LOAD LIST ;7/20/90  09:35
 ;;5.2;AUTOMATED LAB INSTRUMENTS;**81**;Sep 27, 1994;Build 2
ADD ;
 I '$D(^LRO(68,LRAA,1,LRAD,1,X,0)) W !,$C(7),"THIS IS NOT A VALID ACCESSION NUMBER " Q
 S ^TMP("LR",$J,"T",X)=+^(0)_U_+(^(5,1,0)) W !,"  <<<  ADDED  >>> ",! Q
 Q
DELETE ;
 I '$D(^TMP("LR",$J,"T",X)) W !,$C(7),"THIS NUMBER IS NOT ON THE LIST " Q
 K ^TMP("LR",$J,"T",X) W !,"  <<<  DELETED  >>> ",! Q
 Q
STUFF ;
 S LRAA=$S(LRALL:$P(^LRO(68.2,LRINST,10,+$O(^LRO(68.2,LRINST,10,0)),0),U,2),1:$P(^LRO(68.2,LRINST,10,LRPROF,0),U,2))
 S:'$D(^LRO(68.2,LRINST,1,0)) ^(0)="^68.21^"
 F LRAN=0:0 S LRAN=$O(^TMP("LR",$J,"T",LRAN)) Q:LRAN<1  S LRSPEC=$P(^(LRAN),U,2) D STUFF1 I $O(X(0)) D STUFF3
 S $P(^LRO(68.2,LRINST,2),U,4)=LRTRAY,$P(^(2),U,5)=LRCUP,$P(^(2),U)=DT
 Q
STUFF1 ;
 K X F AA=0:0 S AA=$O(^LRO(68,LRAA,1,LRAD,1,LRAN,4,AA)) Q:AA<1  I $D(^(AA,0)) S LRURG=$S($P(^(0),U,2):$P(^(0),U,2),1:9) I $D(LRTP(AA)) D STUFF2
 Q
STUFF2 ;
 I LRTP(AA) Q:LRSPEC=LRTP(AA)
 S X(AA)=AA_U_LRURG,X(AA,$O(LRTP(AA,0)))="" Q
STUFF3 ;
 X LRTRANS I '$D(^LRO(68.2,LRINST,1,LRTRAY,0)) S ^(0)=LRTRAY_U_DT_U_DUZ_U_LRAA,$P(^LRO(68.2,LRINST,1,0),U,3)=LRTRAY,$P(^(0),U,4)=$P(^(0),U,4)+1 W !,"B"
 S:'$D(^LRO(68.2,LRINST,1,LRTRAY,1,0)) ^(0)="^68.22PA^1^1"
 I '$D(^LRO(68.2,LRINST,1,LRTRAY,1,LRCUP,1,0)) S ^(0)="^68.222^" W "."
 S ^LRO(68.2,LRINST,1,LRTRAY,1,LRCUP,0)=LRAA_U_LRAD_U_LRAN_U_$O(LRTP($O(X(0)),0))_U_LRSPEC
 F X=0:0 S X=$O(X(X)) Q:X=""  S ^LRO(68.2,LRINST,1,LRTRAY,1,LRCUP,1,X,0)=X(X),$P(^LRO(68.2,LRINST,1,LRTRAY,1,LRCUP,1,0),U,3)=X,$P(^(0),U,4)=$P(^(0),U,4)+1 D LRO
 Q
LRO S $P(^LRO(68,LRAA,1,LRAD,1,LRAN,4,X,0),U,3)=LRINST_";"_LRTRAY_";"_LRCUP Q    ;LA*5.2*81 change LRAN,1,4 to LRAN,4 for node/piece set
 Q
PROF ;
 S LRAA=$S($D(^LRO(68.2,LRINST,10,1,0)):+$P(^(0),U,2),1:0) I 'LRAA W !!?10,"NO ACCESSION AREA ASSIGNED " S LREND=1 Q
 S Y(0)=^LRO(68,LRAA,0) I $P(Y(0),U,14) S LRP=14 D ACCESS I LREND W !!?10,"Access denied to this Accession Area." Q
 F I=0:0 S I=$O(^LRO(68.2,LRINST,10,LRPROF,1,I)) Q:I<1  I $D(^(I,0)) S LRTP(+^(0))=$P(^(0),U,2),LRTP(+^(0),LRPROF)=""
 F T=0:0 S T=$O(^LRO(68.2,LRINST,10,LRPROF,2,T)) Q:T<1  F C=0:0 S C=$O(^LRO(68.2,LRINST,10,LRPROF,2,T,1,C)) Q:C<1  S LRCT=^(C,0) D CTRLTST S LRCTRL(T,C)=X
 F I=0:0 S I=$O(^LRO(68.2,LRINST,10,LRPROF,3,I)) Q:I<1  S LRDSPEC(+^(I,0))=""
 Q
CTRLTST ;from LRLL1, LRLL2
 S X=LRCT_U F J=0:0 S J=$O(^LAB(62.3,LRCT,2,J)) Q:J<1  S Y=+^(J,0) S:$D(^LRO(68.2,LRINST,10,LRPROF,1,"B",+Y)) X=X_+Y_U
 I '$P(X,U,2) W !,"CONTROL ",$P(^LAB(62.3,+X,0),U,1)," HAS NO TEST FOR THIS PROFILE."
 Q
CLEAR ;from LRLL
 W !,"WANT TO UNLOAD THE ",$S(LRTYPE:"LOAD",1:"WORK")," LIST FIRST" S %=2 D YN^DICN W:%=0 !,"If you're not sure, we'll skip it." W:%=-1 !,"Nothing cleared." S DUOUT=(%=-1) Q:%'=1
 D CLEAR^LRLLS3 S (LAST,^LRO(68.2,LRINST,2))=DT_"^1^1^0^0",$P(^(1,0),U,3,4)=0 F I=0:0 S I=$O(^LRO(68.2,LRINST,1,0)) Q:I<1  S $P(^(0),U,3)=I,$P(^(0),U,4)=I
 I LRTYPE W !,"Do you want to delete all unverified ",$P(^LRO(68.2,LRINST,0),U)," instrument data" S %=2 D YN^DICN S DUOUT=(%=-1) Q:%'=1  K ^LAH(LRINST)
 Q
ACCESS ;
 S LRKEY=+$P(Y(0),U,LRP),LRKEY=$S($D(^DIC(19.1,LRKEY,0)):$P(^(0),U),1:0),LREND=$S($D(^XUSEC(LRKEY,DUZ)):0,1:1)
 Q