LRVER1 ;DALOI/FHS/JAH - LAB ROUTINE DATA VERIFICATION ;8/10/04
;;5.2;LAB SERVICE;**1027,1031**;NOV 1, 1997
;
;;VA LR Patch(s): 42,153,201,215,239,240,263,232,286,291
;
; NOTE: LR*5.2*1031 restores LR*5.2*1027 modifications
;
VER ; from LRGVP
N LRBEY
S LRLLOC=0,LRCW=8,LROUTINE=$P(^LAB(69.9,1,3),U,2) I $D(^LRO(69,LRODT,1,LRSN,0)) S LRLLOC=$P(^(0),U,7) S:'$L(LRLLOC) LRLLOC=0 W !,$P(^LRO(69,LRODT,1,LRSN,1),U,6)
S LRCDT=$S($D(^LRO(68,LRAA,1,LRAD,1,LRAN,3)):$P(^(3),U,1,2),1:$P(^(0),U,3)_U),LREAL=$P(LRCDT,U,2)
S LRCDT=+LRCDT,LRSAMP=$S($D(^LRO(69,LRODT,1,LRSN,0)):$P(^(0),U,3),1:"")
S LRIDT=$S($P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,3)),U,5):$P(^(3),U,5),1:"")
S:'LRIDT LRIDT=9999999-LRCDT
D EXP
LD S LRSS="CH" ;ONLY WORKS FOR 'CH'
S LRMETH=LRSS IF $D(^LR(LRDFN,LRSS,LRIDT,0)) S LRMETH=$P($P(^(0),U,8),";",1)
W:$D(^LAB(62,+LRSAMP,0)) !,"Sample: ",$P(^(0),U)
K ^TMP("LR",$J,"TMP"),LRORD,LRM
D ^LRVER2
K LRDL
Q
;
;
EXP ; Get the list of tests for this ACC. from LRGVG1
; Do not process tests which have been "NP" (not performed).
N I,N,IX,LRNLT,T1,X
K LRTEST,LRNAME,LRSM60
S LRALERT=LROUTINE,N=0,I=0,IX=+$G(^LRO(68,LRAA,1,LRAD,1,LRAN,5,1,0))
F S I=$O(^LRO(68,LRAA,1,LRAD,1,LRAN,4,I)) Q:I<.5 D
. S X=$G(^LRO(68,LRAA,1,LRAD,1,LRAN,4,I,0))
. I 'X Q
. I $P(X,"^",6)="*Not Performed" Q
. S N=N+1,LRTEST(N)=I,LRNLT=$S($P(X,"^",2)>50:$P(X,U,9),1:$P(X,"^"))
. S LRTEST(N,"P")=LRNLT_U_$$NLT(LRNLT)
. S LRAL=$P(X,U,2)#50
. I LRAL S LRALERT=$S(LRAL<LRALERT:LRAL,1:LRALERT)
;
S LRNTN=N
F T1=1:1:N I $D(^LAB(60,+LRTEST(T1),0)) D
. S LRTEST(T1)=LRTEST(T1)_U_^(0)
. S LRNAME(T1)=$P(LRTEST(T1),U,2),LRNAME(T1,+LRTEST(T1))=""
. S:$G(^(1,IX,3)) LRSM60(+$P(LRTEST(T1),";",2))=^(3)
. D EX1
K IX
N X1,X
S X=$P($H,","),X(1)=$P($H,",",2),I=0
F S I=$O(LRSM60(I)) Q:'I S X1=X-LRSM60(I)_","_X(1),LRSM60(I)=9999999-$$HTFM^XLFDT(X1)
Q
;
;
EX1 ; Expand the list of tests to edit.
Q:'$D(LRTEST(T1))
S X=LRTEST(T1),^TMP("LR",$J,"VTO",+X)=$P($P(X,U,6),";",2)
S ^TMP("LR",$J,"VTO",+X,"P")=LRTEST(T1,"P"),S1=0,J=0
D EX2
K S1,J
Q
;
EX2 ;
S:'$D(LRCFL) LRCFL=""
S LRSUB=$P(X,U,6)
; I $D(^LAB(60,+X,4)),$P(^(4),"^",2) S LRCFL=LRCFL_$P(^(4),"^",2)_U
;
;----- BEGIN IHS/OIT/MKK MODIFICATIONS LR*5.2*1027
I $D(^LAB(60,+X,4)),$P($G(^(4)),"^",2) S:'($D(LRCFL)#2) LRCFL="" S LRCFL=LRCFL_$P($G(^(4)),"^",2)_U
;----- END IHS/OIT/MKK MODIFICATIONS LR*5.2*1027
;
; If atomic test then setup and quit
I LRSUB'="" D Q
. S S2=$P(LRSUB,";",2)
. D:'$D(^TMP("LR",$J,"TMP",S2)) ORD
;
; Explode panel tests
; Do not process tests which have been "NP" (not performed).
S S1=S1+1,S1(S1)=X,S1(S1,1)=J
S J=0
F S J=$O(^LAB(60,+S1(S1),2,J)) Q:J<1 D
. S Y=+^(J,0),X=Y_U_^LAB(60,Y,0)
. I $P($G(^LRO(68,+$G(LRAA),1,+$G(LRAD),1,+$G(LRAN),4,Y,0)),"^",6)="*Not Performed" Q
. D EX2
S X=S1(S1),J=S1(S1,1),S1=S1-1
Q
;
;
ORD ;
; LRNX is set by caller
S LRNX=+$G(LRNX)+1,LRORD(LRNX)=S2
S LRBEY($P(LRTEST(T1),U,1),S2)="" ; CIDC
S ^TMP("LR",$J,"TMP",S2)=+X
; If panel being exploded then set parent("P" node)
; to file #60 test being exploded
I $G(LRTEST(T1,"P")) D
. I +LRTEST(T1)=+LRTEST(T1,"P") S ^TMP("LR",$J,"TMP",S2,"P")=LRTEST(T1,"P")_"!"_$$RNLT(+X)
. E S ^TMP("LR",$J,"TMP",S2,"P")=+LRTEST(T1)_U_$$NLT(+LRTEST(T1))_"!"_$$RNLT(+X)
;
I $P(X,U,18) D
. S LRM(S2)=+X
. S LRM(S2,"P")=$G(^TMP("LR",$J,"TMP",S2,"P"))
. S LRMX(+X)=""
Q
;
;
NLT(X) ;
N Y
S Y=$S($P($G(^LAM(+$G(^LAB(60,+X,64)),0)),U,2):$P(^(0),U,2),1:"")
Q Y
;
;
RNLT(X) ;
I 'X Q ""
N Y
S Y(1)=+$P($G(^LAB(60,X,64)),U,2)
S Y=$S($P($G(^LAM(Y(1),0)),U,2):$P(^(0),U,2),1:"")
I Y S $P(Y,"!",2)=$$LNC(Y,$G(LRCDEF),$G(LRSPEC))
S $P(Y,"!",3)=$G(LRCDEF),$P(Y,"!",6)=X
Q Y
;
;
LNC(LRNLT,LRCDEF,LRSPEC) ;reture the LOINC code for WKLD Code/Specimen
; Call with (nlt code,method suffix,test specimen)
; TA = Time Aspect
N X,N,Y,LRSPECN,VAL,ERR,TA S X=""
Q:'LRNLT X
K LRMSGM
S:$G(LRCDEF)="" LRCDEF="0000"
I $P(LRCDEF,".",2) S LRCDEF=$P(LRCDEF,".",2)
S LRCDEF=$S($P(LRNLT,".",2):$P(LRNLT,".",2),1:LRCDEF)
I $L(LRCDEF)'=4 S LRCDEF=LRCDEF_$E("0000",$L(LRCDEF),($L(LRCDEF-4)))
S LRCDEF=LRCDEF_" "
S LRSPEC=+LRSPEC
;Get time aspect from 61
S TA=$$GET1^DIQ(61,LRSPEC_",",.0961,"I")
S LRSPECN=$S($D(^LAB(61,LRSPEC,0))#2:$$GET1^DIQ(61,LRSPEC_",",.01),1:"Unknown")
S LRNLT=$P(LRNLT,".")_"."
;Check for WKLD CODE_LOAD/WORK LIST method suffix
S VAL(1)=LRNLT_LRCDEF
S N=$$FIND1^DIC(64,"","X",.VAL,"C","","ERR")
;Looking for specimen specific LOINC
I N,LRSPEC D I X D MSG(1) Q X
. I TA S X=$$GET1^DIQ(64.02,TA_","_LRSPEC_","_N_",",4,"I") Q:X
. S TA=$O(^LAM(N,5,LRSPEC,1,0)) ; get time aspect
. I TA S X=$$GET1^DIQ(64.02,TA_","_LRSPEC_","_N_",",4,"I") Q:X
;Looking LOINC default
I N S X=$$LDEF(N) I X D MSG(2) Q X
I LRCDEF="0000 " Q ""
;Looking for WKLD CODE_GENERIC suffix
K VAL
S VAL(1)=LRNLT_"0000 "
S N=$$FIND1^DIC(64,"","X",.VAL,"C","","ERR")
I 'N Q ""
;Looking for WKLD CODE_GENERIC specimen specific LOINC
I LRSPEC D I X D MSG(3) Q X
. I TA S X=$$GET1^DIQ(64.02,TA_","_LRSPEC_","_N_",",4,"I") Q:X
. S TA=$O(^LAM(N,5,LRSPEC,1,0)) ; get time aspect
. I TA S X=$$GET1^DIQ(64.02,TA_","_LRSPEC_","_N_",",4,"I") Q:X
;Looking for WKLD CODE_GENERIC default LOINC
I 'X,N S X=$$LDEF(N) I X D MSG(4)
I 'X S X=""
Q X
;
;
LDEF(Y) ;Find the default LOINC code for WKLD CODE
I 'Y Q ""
S X=$$GET1^DIQ(64,Y_",",25,"I")
I 'X S X=""
Q X
;
;
TMPSB(LRSB) ; Get LOINC code from ^TMP("LR",$J,"TMP",LRSB,"P")
S NODE=$G(^TMP("LR",$J,"TMP",LRSB,"P"))
I 'NODE Q ""
S $P(NODE,"!",3)=$$LNC($P(NODE,"!",2),$G(LRCDEF),$G(LRSPEC))
S $P(NODE,"!",4)=$G(LRCDEF)
Q $P(NODE,U,2)
;
;
MSG(VAL) ;Set output message
Q:'$G(LRMSG)
S LRMSGM="0-No LOINC Code Defined for "_LRNLT_LRCDEF
N TANAME
I $G(TA) S TANAME=$$GET1^DIQ(64.061,TA_",",.01,"E") ;TA Name
I VAL=1 S LRMSGM="1-"_LRNLT_$E(LRCDEF,1,4)_" - "_LRSPECN
I VAL=2 S LRMSGM="2-"_LRNLT_$E(LRCDEF,1,4)_" - Default LOINC"
I VAL=3 S LRMSGM="3-"_LRNLT_"0000 - "_LRSPECN
I VAL=4 S LRMSGM="4-"_LRNLT_"0000 - Default LOINC"
I $G(TA) S LRMSGM=LRMSGM_" Time Aspect "_TANAME
W:$G(LRDBUG) !,LRMSGM,!
Q
LRVER1 ;DALOI/FHS/JAH - LAB ROUTINE DATA VERIFICATION ;8/10/04
+1 ;;5.2;LAB SERVICE;**1027,1031**;NOV 1, 1997
+2 ;
+3 ;;VA LR Patch(s): 42,153,201,215,239,240,263,232,286,291
+4 ;
+5 ; NOTE: LR*5.2*1031 restores LR*5.2*1027 modifications
+6 ;
VER ; from LRGVP
+1 NEW LRBEY
+2 SET LRLLOC=0
SET LRCW=8
SET LROUTINE=$PIECE(^LAB(69.9,1,3),U,2)
IF $DATA(^LRO(69,LRODT,1,LRSN,0))
SET LRLLOC=$PIECE(^(0),U,7)
IF '$LENGTH(LRLLOC)
SET LRLLOC=0
WRITE !,$PIECE(^LRO(69,LRODT,1,LRSN,1),U,6)
+3 SET LRCDT=$SELECT($DATA(^LRO(68,LRAA,1,LRAD,1,LRAN,3)):$PIECE(^(3),U,1,2),1:$PIECE(^(0),U,3)_U)
SET LREAL=$PIECE(LRCDT,U,2)
+4 SET LRCDT=+LRCDT
SET LRSAMP=$SELECT($DATA(^LRO(69,LRODT,1,LRSN,0)):$PIECE(^(0),U,3),1:"")
+5 SET LRIDT=$SELECT($PIECE($GET(^LRO(68,LRAA,1,LRAD,1,LRAN,3)),U,5):$PIECE(^(3),U,5),1:"")
+6 IF 'LRIDT
SET LRIDT=9999999-LRCDT
+7 DO EXP
LD ;ONLY WORKS FOR 'CH'
SET LRSS="CH"
+1 SET LRMETH=LRSS
IF $DATA(^LR(LRDFN,LRSS,LRIDT,0))
SET LRMETH=$PIECE($PIECE(^(0),U,8),";",1)
+2 IF $DATA(^LAB(62,+LRSAMP,0))
WRITE !,"Sample: ",$PIECE(^(0),U)
+3 KILL ^TMP("LR",$JOB,"TMP"),LRORD,LRM
+4 DO ^LRVER2
+5 KILL LRDL
+6 QUIT
+7 ;
+8 ;
EXP ; Get the list of tests for this ACC. from LRGVG1
+1 ; Do not process tests which have been "NP" (not performed).
+2 NEW I,N,IX,LRNLT,T1,X
+3 KILL LRTEST,LRNAME,LRSM60
+4 SET LRALERT=LROUTINE
SET N=0
SET I=0
SET IX=+$GET(^LRO(68,LRAA,1,LRAD,1,LRAN,5,1,0))
+5 FOR
SET I=$ORDER(^LRO(68,LRAA,1,LRAD,1,LRAN,4,I))
IF I<.5
QUIT
Begin DoDot:1
+6 SET X=$GET(^LRO(68,LRAA,1,LRAD,1,LRAN,4,I,0))
+7 IF 'X
QUIT
+8 IF $PIECE(X,"^",6)="*Not Performed"
QUIT
+9 SET N=N+1
SET LRTEST(N)=I
SET LRNLT=$SELECT($PIECE(X,"^",2)>50:$PIECE(X,U,9),1:$PIECE(X,"^"))
+10 SET LRTEST(N,"P")=LRNLT_U_$$NLT(LRNLT)
+11 SET LRAL=$PIECE(X,U,2)#50
+12 IF LRAL
SET LRALERT=$SELECT(LRAL<LRALERT:LRAL,1:LRALERT)
End DoDot:1
+13 ;
+14 SET LRNTN=N
+15 FOR T1=1:1:N
IF $DATA(^LAB(60,+LRTEST(T1),0))
Begin DoDot:1
+16 SET LRTEST(T1)=LRTEST(T1)_U_^(0)
+17 SET LRNAME(T1)=$PIECE(LRTEST(T1),U,2)
SET LRNAME(T1,+LRTEST(T1))=""
+18 IF $GET(^(1,IX,3))
SET LRSM60(+$PIECE(LRTEST(T1),";",2))=^(3)
+19 DO EX1
End DoDot:1
+20 KILL IX
+21 NEW X1,X
+22 SET X=$PIECE($HOROLOG,",")
SET X(1)=$PIECE($HOROLOG,",",2)
SET I=0
+23 FOR
SET I=$ORDER(LRSM60(I))
IF 'I
QUIT
SET X1=X-LRSM60(I)_","_X(1)
SET LRSM60(I)=9999999-$$HTFM^XLFDT(X1)
+24 QUIT
+25 ;
+26 ;
EX1 ; Expand the list of tests to edit.
+1 IF '$DATA(LRTEST(T1))
QUIT
+2 SET X=LRTEST(T1)
SET ^TMP("LR",$JOB,"VTO",+X)=$PIECE($PIECE(X,U,6),";",2)
+3 SET ^TMP("LR",$JOB,"VTO",+X,"P")=LRTEST(T1,"P")
SET S1=0
SET J=0
+4 DO EX2
+5 KILL S1,J
+6 QUIT
+7 ;
EX2 ;
+1 IF '$DATA(LRCFL)
SET LRCFL=""
+2 SET LRSUB=$PIECE(X,U,6)
+3 ; I $D(^LAB(60,+X,4)),$P(^(4),"^",2) S LRCFL=LRCFL_$P(^(4),"^",2)_U
+4 ;
+5 ;----- BEGIN IHS/OIT/MKK MODIFICATIONS LR*5.2*1027
+6 IF $DATA(^LAB(60,+X,4))
IF $PIECE($GET(^(4)),"^",2)
IF '($DATA(LRCFL)#2)
SET LRCFL=""
SET LRCFL=LRCFL_$PIECE($GET(^(4)),"^",2)_U
+7 ;----- END IHS/OIT/MKK MODIFICATIONS LR*5.2*1027
+8 ;
+9 ; If atomic test then setup and quit
+10 IF LRSUB'=""
Begin DoDot:1
+11 SET S2=$PIECE(LRSUB,";",2)
+12 IF '$DATA(^TMP("LR",$JOB,"TMP",S2))
DO ORD
End DoDot:1
QUIT
+13 ;
+14 ; Explode panel tests
+15 ; Do not process tests which have been "NP" (not performed).
+16 SET S1=S1+1
SET S1(S1)=X
SET S1(S1,1)=J
+17 SET J=0
+18 FOR
SET J=$ORDER(^LAB(60,+S1(S1),2,J))
IF J<1
QUIT
Begin DoDot:1
+19 SET Y=+^(J,0)
SET X=Y_U_^LAB(60,Y,0)
+20 IF $PIECE($GET(^LRO(68,+$GET(LRAA),1,+$GET(LRAD),1,+$GET(LRAN),4,Y,0)),"^",6)="*Not Performed"
QUIT
+21 DO EX2
End DoDot:1
+22 SET X=S1(S1)
SET J=S1(S1,1)
SET S1=S1-1
+23 QUIT
+24 ;
+25 ;
ORD ;
+1 ; LRNX is set by caller
+2 SET LRNX=+$GET(LRNX)+1
SET LRORD(LRNX)=S2
+3 ; CIDC
SET LRBEY($PIECE(LRTEST(T1),U,1),S2)=""
+4 SET ^TMP("LR",$JOB,"TMP",S2)=+X
+5 ; If panel being exploded then set parent("P" node)
+6 ; to file #60 test being exploded
+7 IF $GET(LRTEST(T1,"P"))
Begin DoDot:1
+8 IF +LRTEST(T1)=+LRTEST(T1,"P")
SET ^TMP("LR",$JOB,"TMP",S2,"P")=LRTEST(T1,"P")_"!"_$$RNLT(+X)
+9 IF '$TEST
SET ^TMP("LR",$JOB,"TMP",S2,"P")=+LRTEST(T1)_U_$$NLT(+LRTEST(T1))_"!"_$$RNLT(+X)
End DoDot:1
+10 ;
+11 IF $PIECE(X,U,18)
Begin DoDot:1
+12 SET LRM(S2)=+X
+13 SET LRM(S2,"P")=$GET(^TMP("LR",$JOB,"TMP",S2,"P"))
+14 SET LRMX(+X)=""
End DoDot:1
+15 QUIT
+16 ;
+17 ;
NLT(X) ;
+1 NEW Y
+2 SET Y=$SELECT($PIECE($GET(^LAM(+$GET(^LAB(60,+X,64)),0)),U,2):$PIECE(^(0),U,2),1:"")
+3 QUIT Y
+4 ;
+5 ;
RNLT(X) ;
+1 IF 'X
QUIT ""
+2 NEW Y
+3 SET Y(1)=+$PIECE($GET(^LAB(60,X,64)),U,2)
+4 SET Y=$SELECT($PIECE($GET(^LAM(Y(1),0)),U,2):$PIECE(^(0),U,2),1:"")
+5 IF Y
SET $PIECE(Y,"!",2)=$$LNC(Y,$GET(LRCDEF),$GET(LRSPEC))
+6 SET $PIECE(Y,"!",3)=$GET(LRCDEF)
SET $PIECE(Y,"!",6)=X
+7 QUIT Y
+8 ;
+9 ;
LNC(LRNLT,LRCDEF,LRSPEC) ;reture the LOINC code for WKLD Code/Specimen
+1 ; Call with (nlt code,method suffix,test specimen)
+2 ; TA = Time Aspect
+3 NEW X,N,Y,LRSPECN,VAL,ERR,TA
SET X=""
+4 IF 'LRNLT
QUIT X
+5 KILL LRMSGM
+6 IF $GET(LRCDEF)=""
SET LRCDEF="0000"
+7 IF $PIECE(LRCDEF,".",2)
SET LRCDEF=$PIECE(LRCDEF,".",2)
+8 SET LRCDEF=$SELECT($PIECE(LRNLT,".",2):$PIECE(LRNLT,".",2),1:LRCDEF)
+9 IF $LENGTH(LRCDEF)'=4
SET LRCDEF=LRCDEF_$EXTRACT("0000",$LENGTH(LRCDEF),($LENGTH(LRCDEF-4)))
+10 SET LRCDEF=LRCDEF_" "
+11 SET LRSPEC=+LRSPEC
+12 ;Get time aspect from 61
+13 SET TA=$$GET1^DIQ(61,LRSPEC_",",.0961,"I")
+14 SET LRSPECN=$SELECT($DATA(^LAB(61,LRSPEC,0))#2:$$GET1^DIQ(61,LRSPEC_",",.01),1:"Unknown")
+15 SET LRNLT=$PIECE(LRNLT,".")_"."
+16 ;Check for WKLD CODE_LOAD/WORK LIST method suffix
+17 SET VAL(1)=LRNLT_LRCDEF
+18 SET N=$$FIND1^DIC(64,"","X",.VAL,"C","","ERR")
+19 ;Looking for specimen specific LOINC
+20 IF N
IF LRSPEC
Begin DoDot:1
+21 IF TA
SET X=$$GET1^DIQ(64.02,TA_","_LRSPEC_","_N_",",4,"I")
IF X
QUIT
+22 ; get time aspect
SET TA=$ORDER(^LAM(N,5,LRSPEC,1,0))
+23 IF TA
SET X=$$GET1^DIQ(64.02,TA_","_LRSPEC_","_N_",",4,"I")
IF X
QUIT
End DoDot:1
IF X
DO MSG(1)
QUIT X
+24 ;Looking LOINC default
+25 IF N
SET X=$$LDEF(N)
IF X
DO MSG(2)
QUIT X
+26 IF LRCDEF="0000 "
QUIT ""
+27 ;Looking for WKLD CODE_GENERIC suffix
+28 KILL VAL
+29 SET VAL(1)=LRNLT_"0000 "
+30 SET N=$$FIND1^DIC(64,"","X",.VAL,"C","","ERR")
+31 IF 'N
QUIT ""
+32 ;Looking for WKLD CODE_GENERIC specimen specific LOINC
+33 IF LRSPEC
Begin DoDot:1
+34 IF TA
SET X=$$GET1^DIQ(64.02,TA_","_LRSPEC_","_N_",",4,"I")
IF X
QUIT
+35 ; get time aspect
SET TA=$ORDER(^LAM(N,5,LRSPEC,1,0))
+36 IF TA
SET X=$$GET1^DIQ(64.02,TA_","_LRSPEC_","_N_",",4,"I")
IF X
QUIT
End DoDot:1
IF X
DO MSG(3)
QUIT X
+37 ;Looking for WKLD CODE_GENERIC default LOINC
+38 IF 'X
IF N
SET X=$$LDEF(N)
IF X
DO MSG(4)
+39 IF 'X
SET X=""
+40 QUIT X
+41 ;
+42 ;
LDEF(Y) ;Find the default LOINC code for WKLD CODE
+1 IF 'Y
QUIT ""
+2 SET X=$$GET1^DIQ(64,Y_",",25,"I")
+3 IF 'X
SET X=""
+4 QUIT X
+5 ;
+6 ;
TMPSB(LRSB) ; Get LOINC code from ^TMP("LR",$J,"TMP",LRSB,"P")
+1 SET NODE=$GET(^TMP("LR",$JOB,"TMP",LRSB,"P"))
+2 IF 'NODE
QUIT ""
+3 SET $PIECE(NODE,"!",3)=$$LNC($PIECE(NODE,"!",2),$GET(LRCDEF),$GET(LRSPEC))
+4 SET $PIECE(NODE,"!",4)=$GET(LRCDEF)
+5 QUIT $PIECE(NODE,U,2)
+6 ;
+7 ;
MSG(VAL) ;Set output message
+1 IF '$GET(LRMSG)
QUIT
+2 SET LRMSGM="0-No LOINC Code Defined for "_LRNLT_LRCDEF
+3 NEW TANAME
+4 ;TA Name
IF $GET(TA)
SET TANAME=$$GET1^DIQ(64.061,TA_",",.01,"E")
+5 IF VAL=1
SET LRMSGM="1-"_LRNLT_$EXTRACT(LRCDEF,1,4)_" - "_LRSPECN
+6 IF VAL=2
SET LRMSGM="2-"_LRNLT_$EXTRACT(LRCDEF,1,4)_" - Default LOINC"
+7 IF VAL=3
SET LRMSGM="3-"_LRNLT_"0000 - "_LRSPECN
+8 IF VAL=4
SET LRMSGM="4-"_LRNLT_"0000 - Default LOINC"
+9 IF $GET(TA)
SET LRMSGM=LRMSGM_" Time Aspect "_TANAME
+10 IF $GET(LRDBUG)
WRITE !,LRMSGM,!
+11 QUIT