source: WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LRBLDRR.m@ 1073

Last change on this file since 1073 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 4.4 KB
Line 
1LRBLDRR ;AVAMC/REG/CYM - REVIEW/RELEASE COMPONENTS ;1/24/97 11:04 ;
2 ;;5.2;LAB SERVICE;**72,90,97,247**;Sep 27, 1994
3 ;Per VHA Directive 97-033 this routine should not be modified. Medical Device # BK970021
4 D E S LR("M")=1,X="BLOOD BANK" D ^LRUTL G:Y=-1 E D D^LRBLU G:'$D(X) E
5 I LRCAPA S X="DONOR UNIT LABELING" D X^LRUWK G:'$D(X) E S Y="RR" D S^LRBLWD K LRT S X="UNIT LOG-IN/SEND-OUT" D X^LRUWK G:'$D(X) E
6 S LRA=$S($D(^LAB(69.9,1,8,1,0)):$P(^(0),"^",2),1:0),Y="LG" D:LRCAPA S^LRBLWD
7 W !!?20,"Review-label-release components",!!?20,LRAA(4),! D BAR^LRBLB I LR W !!?15,"STANDARD UNIT ID LABELING " S %=1 D YN^LRU G:%<1 E S LR(3)=$S(%=1:"",1:1)
8 F A=1,6.1,10:1:16,18,19 D
9 . D FIELD^DID(65.54,A,"","POINTER","LRB") S LRB(A)=LRB("POINTER")
10 . D FIELD^DID(65.54,A,"","LABEL","LRN") S LRN(A)=LRN("LABEL")
11 F A=17,20 I $G(LRH(A)) D
12 . D FIELD^DID(65.54,A,"","POINTER","LRB") S LRB(A)=LRB("POINTER")
13 . D FIELD^DID(65.54,A,"","LABEL","LRN") S LRN(A)=LRN("LABEL")
14P R !!,"Select UNIT FOR LABEL/RELEASE: ",X:DTIME I LR D U^LRBLB
15 W ! S DIC="^LRE(",DIC(0)="FQMZ",D="C^B" D MIX^DIC1 K DIC G E:X[U!(X=""),P:Y<1 S LRQ(5)=$P(Y(0),"^",5),LRQ(6)=$P(Y(0),"^",6),LRQ("X")=0
16 I X["," D ASK G:Y<1 P D REST G P
17 S LRQ=+Y,LRI=$O(^LRE("C",X,LRQ,0)) G:'LRI P L +^LRE(LRQ,5,LRI):5 I '$T W !,$C(7),"Someone else is editing this entry! " G P
18 S LRG=$P(^LRE(LRQ,5,LRI,0),"^",4) D REST G P
19 ;
20S S F=^LAB(66,A,0),Y=$P(X,"^",3) D D^LRU S S=Y,Y=$P(X,"^",4) D D^LRU
21 S F(B)=$P(X,"^",2)_"^"_$P(X,"^",6)_"^"_$P(X,"^",7)_"^"_$E($P(F,"^"),1,21)_"^"_S_"^"_Y_"^"_A_"^"_$P(F,"^",9)_"^"_$P(X,"^",8)_"^"_$P(F,"^",19) Q
22 ;
23REST S LRV=$P(^LRE(LRQ,0),"^",15),X=^(5,LRI,0),LRQ("S")=$P(X,"^",11),LRQ("D")=$P(X,"^",12),T=$S($D(^(2)):$P(^(2),"^",3),1:"") F A=10,11 S LRJ(A+.4)=$S($D(^(A)):$P(^(A),"^",4),1:"")
24 F A=10:1:20 S (LRJ(A),LRE(A),LRW(A))=""
25 F A=10:1:16,18,19 I $D(^LRE(LRQ,5,LRI,A)) S B=^(A),LRJ(A)=$P(B,"^"),LRW(A)=$P(B,"^",3),LRE(A)=$P(B,"^",2)
26 F A=17,20 I $G(LRH(A)),$D(^LRE(LRQ,5,LRI,A)) S B=^(A),LRJ(A)=$P(B,U),LRW(A)=$P(B,U,3),LRE(A)=$P(B,U,2)
27 S V=$P(X,"^",10),V(10)=LRJ(10),V(11)=LRJ(11),V(12)=V(10)_" "_V(11),LRJ(1)=$P(X,"^",2),(W,LRJ(6.1))=$P(X,"^",10)
28 F A=1,6.1,10:1:16,18,19 S X=LRJ(A),B=LRB(A),X=$S(X]"":$P($P(B,X_":",2),";"),1:"") S LRJ(A)=X
29 F A=17,20 I $G(LRH(A)) S X=LRJ(A),B=LRB(A),X=$S(X]"":$P($P(B,X_":",2),";"),1:"") S LRJ(A)=X
30 W @IOF I LRQ("S")]"","AD"[LRQ("S") W $C(7)
31 W $S(LRQ("S")="A":"AUTOLOGOUS ",LRQ("S")="D":"DIRECTED ",1:" ") I LRQ("D") W "For: " S X=^LR(LRQ("D"),0),Y=$P(X,"^",3),(LRDPF,X)=$P(X,"^",2),X=^DIC(X,0,"GL"),X=@(X_Y_",0)"),SSN=$P(X,"^",9) D SSN^LRU W $P(X,"^")," ",SSN
32 W ?53,"Unit: ",LRG
33 W !,"Unit testing:",?70,"Tech" F A=10:1:16,18,19 D W
34 F A=17,20 I $G(LRH(A)) D W
35 I LRJ(10)=""!(LRJ(11)="") W $C(7),!,"Must perform ABO/Rh testing !!",! D FRE^LRBLDRR1 Q
36 I LRA S A=0 D EN1^LRBLDRR2 Q:A
37 I LRJ(10)'=LRQ(5) W $C(7),!,"Donor ABO (",LRQ(5),") is different from unit ABO (",LRJ(10),"). Resolve discrepancy." S LRD=1
38 I $E(LRJ(11),1,3)'=LRQ(6) W $C(7),!,"Donor Rh (",LRQ(6),") is different from unit Rh (",$E(LRJ(11),1,3),"). Resolve discrepancy." S LRD=1
39 I $D(LRD),'$D(^XUSEC("LRBLSUPER",DUZ)) D FRE^LRBLDRR1 Q
40 I $D(LRD) K LRD D SUPER I $D(LRY) K LRY Q
41 K F S A=0 F B=1:1 S A=$O(^LRE(LRQ,5,LRI,66,A)) Q:'A S X=^(A,0) D S
42 I B<2 W $C(7),!!,"No components prepared !",! D FRE^LRBLDRR1 Q
43 S Y=T D D^LRU W !!,"Donation: ",LRJ(1),?36,"Collection completed: ",Y,!?5,"Component",?36,"Date/time stored",?58,"Expiration date" S A=0
44 F B=0:1 S A=$O(F(A)) Q:'A S L=$P(F(A),U,9) W !,$J(A,2),".",?5,$P(F(A),U,4),?27,$S(L=2:"Discard",L=1:"Quarant",$P(F(A),U,3)]"":"released",$P(F(A),U,2)]"":"labeled",1:""),?36,$P(F(A),U,5),?58,$P(F(A),U,6)
45 I V W $C(7),!!,LRN(6.1),": ",LRJ(6.1) Q
46 D ^LRBLDRR1 Q
47SUPER W !!,"If you continue with label/release of ",LRG," a message will be",!,"sent to all users holding the blood bank supervisor's key.",!,"Do you want to continue with label/release of ",LRG S %=2 D YN^LRU I %=2 D FRE^LRBLDRR1 S LRY=1 Q
48 S LR("TXT",1,0)="Blood donor unit ID: "_LRG,LR("KEY")="LRBLSUPER",LR("SUB")="Donor unit label/release with ABO/Rh discrepancy",LR("TXT",2,0)=" Component(s) have been labeled/released with ABO/Rh donor/unit ID discrepancy"
49 D ^LRUMSG Q
50ASK S LRQ=+Y,DIC="^LRE(LRQ,5,",DIC(0)="FAEQM",DIC("A")="Select DONATION DATE: " D ^DIC K DIC I X["^"!(X="") S Y=-1 Q
51 S LRI=+Y,LRG=$P(^LRE(LRQ,5,LRI,0),U,4) Q
52E D V^LRU Q
53W W !?5,LRN(A),?36,": ",LRJ(A),?70,$S(LRE(A)="":"",$D(^VA(200,LRE(A),0)):$P(^(0),"^",2),1:LRE(A)) I LRW(A)]"" W !,LRW(A)
54 Q
Note: See TracBrowser for help on using the repository browser.