LRBLJPH ;AVAMC/REG - UNIT PHENOTYPE BY ABO/RH ;2/18/93 09:26 ;
;;5.2;LAB SERVICE;**247**;Sep 27, 1994
;Per VHA Directive 97-033 this routine should not be modified. Medical Device # BK970021
D END W !!,"Phenotyped units" S C(9)="POSNEG"
ABO R !,"Select ABO group: ",C(7):DTIME Q:C(7)["^"!(C(7)="") I C(7)'="A"&(C(7)'="B")&(C(7)'="O")&(C(7)'="AB") W $C(7),!,"Enter A, B, AB or O" G ABO
RH R !,"Select Rh type: ",X:DTIME G:X=""!(X["^") END I X'?1"N".U&(X'?1"P".U)!($L(X)>3)!(C(9)'[X) W $C(7)," Enter 'NEG' or 'POS'" G RH
S C(8)=$S($A(X)=80:"POS",1:"NEG") W $E(C(8),$L(X)+1,3)
S ZTRTN="QUE^LRBLJPH" D BEG^LRUTL G:POP!($D(ZTSK)) END
QUE U IO D L^LRU,S^LRU S Z=0,X="N",%DT="T" D ^%DT S N=Y,H=$P(Y,".") D D^LRU S Z(1)=Y D H S LR("F")=1
F X=0:0 S X=$O(^LAB(66,X)) Q:'X S Y=^(X,0) I $P(Y,"^",19) S LRC(X)=""
F C=0:0 S C=$O(LRC(C)) Q:'C!(LR("Q")) D A
W:'Z !!,"No phenotyped ",C(7)," ",C(8)," units available !" D END,END^LRUTL Q
;
A S (A,LRE)=0 F LRB=0:1 S A=$O(^LRD(65,"AI",C,A)) Q:A=""!(LR("Q")) S Q=$O(^LRD(65,"AI",C,A,0)) Q:'Q D I
Q
I I Q[".",Q<N K ^LRD(65,"AI",C,A,Q) Q
I Q<H K ^LRD(65,"AI",C,A,Q) Q
K F,J S V=+$O(^LRD(65,"AI",C,A,Q,0)) Q:'$D(^LRD(65,V,0)) S F=^(0)
Q:$P(F,"^",7)'=C(7)!($P(F,"^",8)'=C(8))
I '$O(^LRD(65,V,60,0)),'$O(^LRD(65,V,70,0)) Q
S LRE=LRE+1 W:LRE=1 !!,$P(^LAB(66,C,0),U),":" S Z=Z+1 D:$Y>(IOSL-6) H1 Q:LR("Q") W !,$J(Z,3),")" W ?5,$P(F,"^"),?20 S Y=$P(F,"^",6) D D^LRU W Y
F LRDFN=0:0 S LRDFN=$O(^LRD(65,V,2,LRDFN)) Q:'LRDFN!(LR("Q")) I $D(^LRD(65,"AP",LRDFN,V)) D P W !,"Assigned:",$P(X,"^")
S E=1,(F(1),G)="" F B=0:0 S B=$O(^LRD(65,V,60,B)) Q:'B S I=$P(^LAB(61.3,B,0),"^"),F(E)=F(E)_I_" ",G=G+1 I $L(F(E))>19 S F(E)=$P(F(E)," ",1,G-1),E=E+1,F(E)=I_" ",G=""
S K=E,E=1,(J(1),G)="" F B=0:0 S B=$O(^LRD(65,V,70,B)) Q:'B S I=$P(^LAB(61.3,B,0),"^"),J(E)=J(E)_I_" ",G=G+1 I $L(J(E))>18 S J(E)=$P(J(E)," ",1,G-1),E=E+1,J(E)=I_" ",G=""
S:E>K K=E F E=1:1:K W:E>1 ! W:$D(F(E)) ?40,$J(F(E),19) W:$D(J(E)) ?60,"|",$J(J(E),18)
W !,LR("%") Q
;
P S X=^LR(LRDFN,0),Y=$P(X,"^",3),X=^DIC($P(X,"^",2),0,"GL"),X=@(X_Y_",0)") Q
H I $D(LR("F")),IOST?1"C".E D M^LRU Q:LR("Q")
D F^LRU W !,"LABORATORY SERVICE",?40,C(7)," ",C(8)," Phenotyped units"
W !,"Count",?6,"Unit ID",?20,"Exp date",?40,"Antigen(s) present",?60,"| Antigen(s) absent",!,LR("%") Q
H1 D H Q:LR("Q") W !!,$P(^LAB(66,C,0),U) Q
END D V^LRU Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLRBLJPH 2375 printed Nov 22, 2024@17:21:27 Page 2
LRBLJPH ;AVAMC/REG - UNIT PHENOTYPE BY ABO/RH ;2/18/93 09:26 ;
+1 ;;5.2;LAB SERVICE;**247**;Sep 27, 1994
+2 ;Per VHA Directive 97-033 this routine should not be modified. Medical Device # BK970021
+3 DO END
WRITE !!,"Phenotyped units"
SET C(9)="POSNEG"
ABO READ !,"Select ABO group: ",C(7):DTIME
if C(7)["^"!(C(7)="")
QUIT
IF C(7)'="A"&(C(7)'="B")&(C(7)'="O")&(C(7)'="AB")
WRITE $CHAR(7),!,"Enter A, B, AB or O"
GOTO ABO
RH READ !,"Select Rh type: ",X:DTIME
if X=""!(X["^")
GOTO END
IF X'?1"N".U&(X'?1"P".U)!($LENGTH(X)>3)!(C(9)'[X)
WRITE $CHAR(7)," Enter 'NEG' or 'POS'"
GOTO RH
+1 SET C(8)=$SELECT($ASCII(X)=80:"POS",1:"NEG")
WRITE $EXTRACT(C(8),$LENGTH(X)+1,3)
+2 SET ZTRTN="QUE^LRBLJPH"
DO BEG^LRUTL
if POP!($DATA(ZTSK))
GOTO END
QUE USE IO
DO L^LRU
DO S^LRU
SET Z=0
SET X="N"
SET %DT="T"
DO ^%DT
SET N=Y
SET H=$PIECE(Y,".")
DO D^LRU
SET Z(1)=Y
DO H
SET LR("F")=1
+1 FOR X=0:0
SET X=$ORDER(^LAB(66,X))
if 'X
QUIT
SET Y=^(X,0)
IF $PIECE(Y,"^",19)
SET LRC(X)=""
+2 FOR C=0:0
SET C=$ORDER(LRC(C))
if 'C!(LR("Q"))
QUIT
DO A
+3 if 'Z
WRITE !!,"No phenotyped ",C(7)," ",C(8)," units available !"
DO END
DO END^LRUTL
QUIT
+4 ;
A SET (A,LRE)=0
FOR LRB=0:1
SET A=$ORDER(^LRD(65,"AI",C,A))
if A=""!(LR("Q"))
QUIT
SET Q=$ORDER(^LRD(65,"AI",C,A,0))
if 'Q
QUIT
DO I
+1 QUIT
I IF Q["."
IF Q<N
KILL ^LRD(65,"AI",C,A,Q)
QUIT
+1 IF Q<H
KILL ^LRD(65,"AI",C,A,Q)
QUIT
+2 KILL F,J
SET V=+$ORDER(^LRD(65,"AI",C,A,Q,0))
if '$DATA(^LRD(65,V,0))
QUIT
SET F=^(0)
+3 if $PIECE(F,"^",7)'=C(7)!($PIECE(F,"^",8)'=C(8))
QUIT
+4 IF '$ORDER(^LRD(65,V,60,0))
IF '$ORDER(^LRD(65,V,70,0))
QUIT
+5 SET LRE=LRE+1
if LRE=1
WRITE !!,$PIECE(^LAB(66,C,0),U),":"
SET Z=Z+1
if $Y>(IOSL-6)
DO H1
if LR("Q")
QUIT
WRITE !,$JUSTIFY(Z,3),")"
WRITE ?5,$PIECE(F,"^"),?20
SET Y=$PIECE(F,"^",6)
DO D^LRU
WRITE Y
+6 FOR LRDFN=0:0
SET LRDFN=$ORDER(^LRD(65,V,2,LRDFN))
if 'LRDFN!(LR("Q"))
QUIT
IF $DATA(^LRD(65,"AP",LRDFN,V))
DO P
WRITE !,"Assigned:",$PIECE(X,"^")
+7 SET E=1
SET (F(1),G)=""
FOR B=0:0
SET B=$ORDER(^LRD(65,V,60,B))
if 'B
QUIT
SET I=$PIECE(^LAB(61.3,B,0),"^")
SET F(E)=F(E)_I_" "
SET G=G+1
IF $LENGTH(F(E))>19
SET F(E)=$PIECE(F(E)," ",1,G-1)
SET E=E+1
SET F(E)=I_" "
SET G=""
+8 SET K=E
SET E=1
SET (J(1),G)=""
FOR B=0:0
SET B=$ORDER(^LRD(65,V,70,B))
if 'B
QUIT
SET I=$PIECE(^LAB(61.3,B,0),"^")
SET J(E)=J(E)_I_" "
SET G=G+1
IF $LENGTH(J(E))>18
SET J(E)=$PIECE(J(E)," ",1,G-1)
SET E=E+1
SET J(E)=I_" "
SET G=""
+9 if E>K
SET K=E
FOR E=1:1:K
if E>1
WRITE !
if $DATA(F(E))
WRITE ?40,$JUSTIFY(F(E),19)
if $DATA(J(E))
WRITE ?60,"|",$JUSTIFY(J(E),18)
+10 WRITE !,LR("%")
QUIT
+11 ;
P SET X=^LR(LRDFN,0)
SET Y=$PIECE(X,"^",3)
SET X=^DIC($PIECE(X,"^",2),0,"GL")
SET X=@(X_Y_",0)")
QUIT
H IF $DATA(LR("F"))
IF IOST?1"C".E
DO M^LRU
if LR("Q")
QUIT
+1 DO F^LRU
WRITE !,"LABORATORY SERVICE",?40,C(7)," ",C(8)," Phenotyped units"
+2 WRITE !,"Count",?6,"Unit ID",?20,"Exp date",?40,"Antigen(s) present",?60,"| Antigen(s) absent",!,LR("%")
QUIT
H1 DO H
if LR("Q")
QUIT
WRITE !!,$PIECE(^LAB(66,C,0),U)
QUIT
END DO V^LRU
QUIT