LAGEN ;VA/DALOI/CJS - LAB AUTOMATED DATA ; 1 Feb 2005
;;5.2;AUTOMATED LAB INSTRUMENTS;**1002,1027,1031**;NOV 01, 1997
;
;;VA LA Patche(s): 1,17,22,27,47,46,64,67
;
Q
;
LOG ; Run by accession number.
S LINK="",LRDFN=0,DPF=2
I $G(LOG)<1 G LG2
; If overlay data -> find if accession exists in LAH
I LROVER D Q:ISQN>0
. N I,X
. S (ISQN,I)=0
. F S I=$O(^LAH(LWL,1,"C",LOG,I)) Q:I<1 D Q:ISQN
. . S X=$G(^LAH(LWL,1,I,0))
. . ; Quit if different accession area.
. . I $P(X,"^",3)'=WL Q
. . ; Quit if different accession date and not a rollover accession (same original accession date).
. . I $P(X,"^",4)'=LADT,$P($G(^LRO(68,WL,1,LADT,1,LOG,0)),"^",3)'=$P($G(^LRO(68,WL,1,$P(X,"^",4),1,LOG,0)),"^",3) Q
. . S ISQN=I
. . D UPDT(LWL,ISQN)
I '$D(^LRO(68,WL,1,LADT,1,LOG,0)) S LINK="^^"_+LOG G LG2
S X=^LRO(68,WL,1,LADT,1,LOG,0),LINK=WL_U_LADT_U_LOG,LRDFN=+X,DPF=$P(X,U,2)
LG2 D ISQN
I $G(LOG)>0 S ^LAH(LWL,1,"C",LOG,ISQN)="",$P(^LAH(LWL,1,ISQN,0),U,3,5)=LINK
I $G(CENUM)>0 S $P(^LAH(LWL,1,ISQN,0),U,6)=CENUM,^LAH(LWL,1,"D",+CENUM,ISQN)=""
I $D(^LRO(68.2,LWL,1,+TRAY,1,+CUP,0)) S ^(4,ISQN)=""
Q
;
;
ISQN ;
L +^LAH(LWL):99999
;
F S (^LAH(LWL),ISQN)=1+$G(^LAH(LWL)) Q:'$D(^LAH(LWL,1,ISQN))
;
S:CUP="" TRAY=1,CUP=ISQN
S ^LAH(LWL,1,ISQN,0)=TRAY_U_CUP_"^^^^^"_METH_"^"_+$G(IDE)
;
D UPDT(LWL,ISQN)
;
S ^LAH(LWL,1,"B",(+TRAY)_";"_(+CUP),ISQN)=""
;
; IDE xref added to enable correct identifier for CX4/CX5 instruments
S ^LAH(LWL,1,"E",+$G(IDE),ISQN)=""
;
; Set UID xref and .3 node, used to verify by unique identifier (UID).
I $G(LA7UID)'="" D UID(LWL,ISQN,LA7UID)
;
L -^LAH(LWL)
Q
;
;
LLIST ;
S LRDFN=0,DPF=2
;
I LROVER D Q:ISQN>0
. S ISQN=+$O(^LAH(LWL,1,"B",(+TRAY)_";"_(+CUP),0))
. I ISQN D UPDT(LWL,ISQN)
;
; Run by load/work list number sent.
D ISQN S LINK="^^"
;
I $D(^LRO(68.2,LWL,1,TRAY,1,CUP,0)) S LINK=$P(^(0),"^",1,3),^(4,ISQN)=""
;
S $P(^LAH(LWL,1,ISQN,0),U,3,5)=LINK
;
S DPF=2
Q:LINK="^^"
S WL=+$P(LINK,"^",1),WDT=+$P(LINK,"^",2),LOG=+$P(LINK,"^",3),^LAH(LWL,1,"C",LOG,ISQN)=""
S X=$S($D(^LRO(68,WL,1,WDT,1,LOG,0)):^(0),1:"0^2"),DPF=+$P(X,U,2),LRDFN=+X
;
Q
;
;
SEQN ;
; Run by the order data received
S CUP=""
D LLIST
Q
;
;
CENUM ;
S DPF=2,LRDFN=0,LOG=$O(^LRO(68,WL,1,DT,1,"D",+CENUM,0))
G LOG:LOG>0 ;for martinez only
;IF CENUM?1A.ANP S Y=CENUM D CEPACK I Y?.ANP S DFN=$O(^LAB(62.3,"B",Y,0)) I DFN S DPF=62.3
;
D ISQN
;
S ^LAH(LWL,1,"C",LOG,ISQN)="",^LAH(LWL,1,"D",+CENUM,ISQN)="",$P(^LAH(LWL,1,ISQN,0),U,6)=CENUM
;
I $D(^LRO(68.2,LWL,1,TRAY,1,CUP,0)) S ^(4,ISQN)=""
Q
;
;
IDENT ;
S DPF=2,LRDFN=0,LOG=$O(^LRO(68,WL,1,DT,1,"C",IDENT,0))
I LOG>0 D LOG Q
D ISQN
Q
;
;
POC ; Entry point for POC interfaces to setup LAH using "E" x-ref
; IDE xref used to identify for POC specimen
I $G(IDE)'="" D Q:ISQN
. S ISQN=$O(^LAH(LWL,1,"E",IDE,0))
. I ISQN D UPDT(LWL,ISQN) Q
D LOG
Q
;
;
CONTROL ; Verify control's
;
Q:'$D(^LRO(68,WL,1,DT,1,LOG,0)) Q:$P(^(0),U,2)'=62.3
;
S LRDFN=+^LRO(68,WL,1,DT,1,LOG,0)
S IDT=+$P($G(^LRO(68,WL,1,DT,1,LOG,3)),"^",3)
I IDT<1 Q
I '$D(^LR(LRDFN,"CH",IDT,0)) Q
S $P(^LRO(68,WL,1,DT,1,LOG,3),U,4)=NOW
S $P(^LR(LRDFN,"CH",IDT,0),U,3)=NOW
;
F I=1:0 S I=$O(^LAH(LWL,1,ISQN,I)) Q:I<1 S ^LR(LRDFN,"CH",IDT,I)=^LAH(LWL,1,ISQN,I)
;
S:'$D(LRTEC) LRTEC=$P(^VA(200,DUZ,0),U,2)
;
F I=0:0 S I=$O(^LRO(68,WL,1,DT,1,LOG,4,I)) Q:I<1 I +$P(^(I,0),U,3)[LWL,'$P(^(0),U,5) S $P(^(0),U,5)=NOW,$P(^(0),U,4)=LRTEC,^LRO(68,WL,1,DT,1,"AC",NOW,LOG)="",^LRO(68,WL,1,DT,1,"AD",NOW\1,LOG)=""
D CONTXREF
K:$G(LOG) ^LAH(LWL,1,"C",+LOG)
K ^LAH(LWL,1,"B",(+TRAY)_";"_(+CUP)),^LAH(LWL,1,ISQN)
;
Q
;
;
CEPACK S Y=$P(Y,"\",1),YY="" F I=1:1:$L(Y) S:$A(Y,I)>32 YY=YY_$E(Y,I)
S Y=YY
K YY
Q
;
;
CONTXREF ; Set up verification X-Ref for controls
;
N DA,LRTEST,LRTN,I,LRGTN,X1,X,S1,J,J1
;
S LRTEST=""
F LRTN=0:0 S LRTN=$O(^LRO(68,WL,1,DT,1,LOG,4,LRTN)) Q:LRTN<1 I $D(^(LRTN,0)),+$P(^(0),U,3)[LWL,+$P(^(0),U,5) S:LRTEST'="" LRTEST=LRTEST_"^"_LRTN S:LRTEST="" LRTEST=LRTN
AC ;
K ^TMP("LR",$J,"T")
D ^LREXPD
F X=0:0 S X=$O(^TMP("LR",$J,"T",X)) Q:X<1 S X1=$P(^(X),";",2) I X1,$D(^LR(LRDFN,"CH",IDT,X1)) S:'$D(^LRO(68,"AC",LRDFN,IDT,X1)) ^(X1)=""
K ^TMP("LR",$J,"T")
Q
;
;
UPDT(LWL,ISQN) ; Set/update date/time this entry in LAH has data added.
; Used by clear instrument data option to allow selective clearing based on date/time criteria.
; Call with LWL = ien of load/list in LAH
; ISQN = ien of sequence
N LANOW,LAX
;
S LANOW=$$NOW^XLFDT
S LAX=$P($G(^LAH(LWL,1,ISQN,0)),"^",10,11)
;
; Created date/time_"^"_update date/time.
S LAX=$S($P(LAX,"^",1):$P(LAX,"^",1),1:LANOW)_"^"_LANOW
S $P(^LAH(LWL,1,ISQN,0),"^",10,11)=LAX
Q
;
;
UID(LWL,ISQN,UID) ; Set .3 node and "U" xref with accession's UID.
; Used to verify by unique identifier (UID).
; Call with LWL = ien of load/list in LAH
; ISQN = ien of sequence
; UID = accession's UID
; Called from above, LRVR1, LRVRW
;
N X
;
S X=$P($G(^LAH(LWL,1,ISQN,.3)),"^")
; Kill x-ref if existing value different than new value.
I X]"",X'=UID K ^LAH(LWL,1,"U",X,ISQN)
;
S $P(^LAH(LWL,1,ISQN,.3),"^")=UID
S ^LAH(LWL,1,"U",UID,ISQN)=""
Q
;
;
POI(LWL,ISQN,NODE,LAID) ; Set .1 node with patient/order info
; Call with LWL = ien of load/list in LAH
; ISQN = ien of sequence
; NODE = node to store data on (PID, OBR)
; LAID = array containing values
; PID - "DFN","DOB","ICN","LRDFN","LRTDFN","PNM","SEX","SSN"
; OBR - "EOL","FID","ORCDT","ORDNLT","ORDP","PON","SID","PEB","PVB"
;
; ^LAH(LWL,1,ISQN,.1,"OBR","EOL") = enterer's ordering location
; ^LAH(LWL,1,ISQN,.1,"OBR","FID") = filler specimen id
; ^LAH(LWL,1,ISQN,.1,"OBR","ORCDT") = order date/time (FileMan d/t)
; ^LAH(LWL,1,ISQN,.1,"OBR","ORDNLT") = order NLT (multiple separated by "^")
; ^LAH(LWL,1,ISQN,.1,"OBR","ORDP") = ordering provider (DUZ or id^last name, first name, mi [id])
; ^LAH(LWL,1,ISQN,.1,"OBR","PEB") = placer entered by (DUZ or id^last name, first name, mi [id])
; ^LAH(LWL,1,ISQN,.1,"OBR","PON") = placer order number
; ^LAH(LWL,1,ISQN,.1,"OBR","PVB") = placer verified by (DUZ or id^last name, first name, mi [id])
; ^LAH(LWL,1,ISQN,.1,"OBR","SID") = placer specimen id
; ^LAH(LWL,1,ISQN,.1,"PID","DFN") = patient's DFN in file #2
; ^LAH(LWL,1,ISQN,.1,"PID","DOB") = date of birth (FileMan d/t)
; ^LAH(LWL,1,ISQN,.1,"PID","ICN") = patient's ICN
; ^LAH(LWL,1,ISQN,.1,"PID","LRDFN") = patient's LRDFN in file #63
; ^LAH(LWL,1,ISQN,.1,"PID","LRTDFN") = patient's LRTDFN in file #67
; ^LAH(LWL,1,ISQN,.1,"PID","PNM") = patient's name
; ^LAH(LWL,1,ISQN,.1,"PID","SEX") = patient's sex
; ^LAH(LWL,1,ISQN,.1,"PID","SSN") = patient's SSN
;
N LAX,LAY,LAZ
;
S LAX=""
F S LAX=$O(LAID(LAX)) Q:LAX="" D
. S LAY=LAID(LAX)
. I LAY="" Q
. S LAZ=$G(^LAH(LWL,1,ISQN,.1,NODE,LAX))
. I LAY=LAZ Q
. ; Remove old data and cross-references.
. I LAZ'="" D
. . K ^LAH(LWL,1,ISQN,.1,NODE,LAX)
. . I $P(LAZ,"^")]"" K ^LAH(LWL,1,"A"_LAX,$P(LAZ,"^"),ISQN)
. ; Set new values and cross-references.
. S ^LAH(LWL,1,ISQN,.1,NODE,LAX)=LAY
. I $P(LAY,"^")'="" S ^LAH(LWL,1,"A"_LAX,$P(LAY,"^"),ISQN)=""
;
Q
;
;
LATYP(LWL,ISQN,LAX) ; Set type of interface for this entry
; Call with LWL = ien of load/list in LAH
; ISQN = ien of sequence
; LAX = type of interface
;
S $P(^LAH(LWL,1,ISQN,0),"^",12)=LAX
Q
;
;
LAMSGID(LWL,ISQN,LAX) ; Set pointer to file #62.49 for this entry.
; Call with LWL = ien of load/list in LAH
; ISQN = ien of sequence
; LAX = ien of entry in file #62.49 that is source of these results
;
S $P(^LAH(LWL,1,ISQN,0),"^",13)=LAX
S ^LAH(LWL,1,ISQN,.01,LAX)=""
Q
;
;
METH(LWL,ISQN,LAX) ; Save instrument name/method for this entry
; Call with LWL = ien of load/list in LAH
; ISQN = ien of sequence
; LAX = method text
;
N X
S X=$P(^LAH(LWL,1,ISQN,0),"^",7)
I X'[LAX S X=LAX_";"_X,$P(^LAH(LWL,1,ISQN,0),"^",7)=X
Q
LAGEN ;VA/DALOI/CJS - LAB AUTOMATED DATA ; 1 Feb 2005
+1 ;;5.2;AUTOMATED LAB INSTRUMENTS;**1002,1027,1031**;NOV 01, 1997
+2 ;
+3 ;;VA LA Patche(s): 1,17,22,27,47,46,64,67
+4 ;
+5 QUIT
+6 ;
LOG ; Run by accession number.
+1 SET LINK=""
SET LRDFN=0
SET DPF=2
+2 IF $GET(LOG)<1
GOTO LG2
+3 ; If overlay data -> find if accession exists in LAH
+4 IF LROVER
Begin DoDot:1
+5 NEW I,X
+6 SET (ISQN,I)=0
+7 FOR
SET I=$ORDER(^LAH(LWL,1,"C",LOG,I))
IF I<1
QUIT
Begin DoDot:2
+8 SET X=$GET(^LAH(LWL,1,I,0))
+9 ; Quit if different accession area.
+10 IF $PIECE(X,"^",3)'=WL
QUIT
+11 ; Quit if different accession date and not a rollover accession (same original accession date).
+12 IF $PIECE(X,"^",4)'=LADT
IF $PIECE($GET(^LRO(68,WL,1,LADT,1,LOG,0)),"^",3)'=$PIECE($GET(^LRO(68,WL,1,$PIECE(X,"^",4),1,LOG,0)),"^",3)
QUIT
+13 SET ISQN=I
+14 DO UPDT(LWL,ISQN)
End DoDot:2
IF ISQN
QUIT
End DoDot:1
IF ISQN>0
QUIT
+15 IF '$DATA(^LRO(68,WL,1,LADT,1,LOG,0))
SET LINK="^^"_+LOG
GOTO LG2
+16 SET X=^LRO(68,WL,1,LADT,1,LOG,0)
SET LINK=WL_U_LADT_U_LOG
SET LRDFN=+X
SET DPF=$PIECE(X,U,2)
LG2 DO ISQN
+1 IF $GET(LOG)>0
SET ^LAH(LWL,1,"C",LOG,ISQN)=""
SET $PIECE(^LAH(LWL,1,ISQN,0),U,3,5)=LINK
+2 IF $GET(CENUM)>0
SET $PIECE(^LAH(LWL,1,ISQN,0),U,6)=CENUM
SET ^LAH(LWL,1,"D",+CENUM,ISQN)=""
+3 IF $DATA(^LRO(68.2,LWL,1,+TRAY,1,+CUP,0))
SET ^(4,ISQN)=""
+4 QUIT
+5 ;
+6 ;
ISQN ;
+1 LOCK +^LAH(LWL):99999
+2 ;
+3 FOR
SET (^LAH(LWL),ISQN)=1+$GET(^LAH(LWL))
IF '$DATA(^LAH(LWL,1,ISQN))
QUIT
+4 ;
+5 IF CUP=""
SET TRAY=1
SET CUP=ISQN
+6 SET ^LAH(LWL,1,ISQN,0)=TRAY_U_CUP_"^^^^^"_METH_"^"_+$GET(IDE)
+7 ;
+8 DO UPDT(LWL,ISQN)
+9 ;
+10 SET ^LAH(LWL,1,"B",(+TRAY)_";"_(+CUP),ISQN)=""
+11 ;
+12 ; IDE xref added to enable correct identifier for CX4/CX5 instruments
+13 SET ^LAH(LWL,1,"E",+$GET(IDE),ISQN)=""
+14 ;
+15 ; Set UID xref and .3 node, used to verify by unique identifier (UID).
+16 IF $GET(LA7UID)'=""
DO UID(LWL,ISQN,LA7UID)
+17 ;
+18 LOCK -^LAH(LWL)
+19 QUIT
+20 ;
+21 ;
LLIST ;
+1 SET LRDFN=0
SET DPF=2
+2 ;
+3 IF LROVER
Begin DoDot:1
+4 SET ISQN=+$ORDER(^LAH(LWL,1,"B",(+TRAY)_";"_(+CUP),0))
+5 IF ISQN
DO UPDT(LWL,ISQN)
End DoDot:1
IF ISQN>0
QUIT
+6 ;
+7 ; Run by load/work list number sent.
+8 DO ISQN
SET LINK="^^"
+9 ;
+10 IF $DATA(^LRO(68.2,LWL,1,TRAY,1,CUP,0))
SET LINK=$PIECE(^(0),"^",1,3)
SET ^(4,ISQN)=""
+11 ;
+12 SET $PIECE(^LAH(LWL,1,ISQN,0),U,3,5)=LINK
+13 ;
+14 SET DPF=2
+15 IF LINK="^^"
QUIT
+16 SET WL=+$PIECE(LINK,"^",1)
SET WDT=+$PIECE(LINK,"^",2)
SET LOG=+$PIECE(LINK,"^",3)
SET ^LAH(LWL,1,"C",LOG,ISQN)=""
+17 SET X=$SELECT($DATA(^LRO(68,WL,1,WDT,1,LOG,0)):^(0),1:"0^2")
SET DPF=+$PIECE(X,U,2)
SET LRDFN=+X
+18 ;
+19 QUIT
+20 ;
+21 ;
SEQN ;
+1 ; Run by the order data received
+2 SET CUP=""
+3 DO LLIST
+4 QUIT
+5 ;
+6 ;
CENUM ;
+1 SET DPF=2
SET LRDFN=0
SET LOG=$ORDER(^LRO(68,WL,1,DT,1,"D",+CENUM,0))
+2 ;for martinez only
IF LOG>0
GOTO LOG
+3 ;IF CENUM?1A.ANP S Y=CENUM D CEPACK I Y?.ANP S DFN=$O(^LAB(62.3,"B",Y,0)) I DFN S DPF=62.3
+4 ;
+5 DO ISQN
+6 ;
+7 SET ^LAH(LWL,1,"C",LOG,ISQN)=""
SET ^LAH(LWL,1,"D",+CENUM,ISQN)=""
SET $PIECE(^LAH(LWL,1,ISQN,0),U,6)=CENUM
+8 ;
+9 IF $DATA(^LRO(68.2,LWL,1,TRAY,1,CUP,0))
SET ^(4,ISQN)=""
+10 QUIT
+11 ;
+12 ;
IDENT ;
+1 SET DPF=2
SET LRDFN=0
SET LOG=$ORDER(^LRO(68,WL,1,DT,1,"C",IDENT,0))
+2 IF LOG>0
DO LOG
QUIT
+3 DO ISQN
+4 QUIT
+5 ;
+6 ;
POC ; Entry point for POC interfaces to setup LAH using "E" x-ref
+1 ; IDE xref used to identify for POC specimen
+2 IF $GET(IDE)'=""
Begin DoDot:1
+3 SET ISQN=$ORDER(^LAH(LWL,1,"E",IDE,0))
+4 IF ISQN
DO UPDT(LWL,ISQN)
QUIT
End DoDot:1
IF ISQN
QUIT
+5 DO LOG
+6 QUIT
+7 ;
+8 ;
CONTROL ; Verify control's
+1 ;
+2 IF '$DATA(^LRO(68,WL,1,DT,1,LOG,0))
QUIT
IF $PIECE(^(0),U,2)'=62.3
QUIT
+3 ;
+4 SET LRDFN=+^LRO(68,WL,1,DT,1,LOG,0)
+5 SET IDT=+$PIECE($GET(^LRO(68,WL,1,DT,1,LOG,3)),"^",3)
+6 IF IDT<1
QUIT
+7 IF '$DATA(^LR(LRDFN,"CH",IDT,0))
QUIT
+8 SET $PIECE(^LRO(68,WL,1,DT,1,LOG,3),U,4)=NOW
+9 SET $PIECE(^LR(LRDFN,"CH",IDT,0),U,3)=NOW
+10 ;
+11 FOR I=1:0
SET I=$ORDER(^LAH(LWL,1,ISQN,I))
IF I<1
QUIT
SET ^LR(LRDFN,"CH",IDT,I)=^LAH(LWL,1,ISQN,I)
+12 ;
+13 IF '$DATA(LRTEC)
SET LRTEC=$PIECE(^VA(200,DUZ,0),U,2)
+14 ;
+15 FOR I=0:0
SET I=$ORDER(^LRO(68,WL,1,DT,1,LOG,4,I))
IF I<1
QUIT
IF +$PIECE(^(I,0),U,3)[LWL
IF '$PIECE(^(0),U,5)
SET $PIECE(^(0),U,5)=NOW
SET $PIECE(^(0),U,4)=LRTEC
SET ^LRO(68,WL,1,DT,1,"AC",NOW,LOG)=""
SET ^LRO(68,WL,1,DT,1,"AD",NOW\1,LOG)=""
+16 DO CONTXREF
+17 IF $GET(LOG)
KILL ^LAH(LWL,1,"C",+LOG)
+18 KILL ^LAH(LWL,1,"B",(+TRAY)_";"_(+CUP)),^LAH(LWL,1,ISQN)
+19 ;
+20 QUIT
+21 ;
+22 ;
CEPACK SET Y=$PIECE(Y,"\",1)
SET YY=""
FOR I=1:1:$LENGTH(Y)
IF $ASCII(Y,I)>32
SET YY=YY_$EXTRACT(Y,I)
+1 SET Y=YY
+2 KILL YY
+3 QUIT
+4 ;
+5 ;
CONTXREF ; Set up verification X-Ref for controls
+1 ;
+2 NEW DA,LRTEST,LRTN,I,LRGTN,X1,X,S1,J,J1
+3 ;
+4 SET LRTEST=""
+5 FOR LRTN=0:0
SET LRTN=$ORDER(^LRO(68,WL,1,DT,1,LOG,4,LRTN))
IF LRTN<1
QUIT
IF $DATA(^(LRTN,0))
IF +$PIECE(^(0),U,3)[LWL
IF +$PIECE(^(0),U,5)
IF LRTEST'=""
SET LRTEST=LRTEST_"^"_LRTN
IF LRTEST=""
SET LRTEST=LRTN
AC ;
+1 KILL ^TMP("LR",$JOB,"T")
+2 DO ^LREXPD
+3 FOR X=0:0
SET X=$ORDER(^TMP("LR",$JOB,"T",X))
IF X<1
QUIT
SET X1=$PIECE(^(X),";",2)
IF X1
IF $DATA(^LR(LRDFN,"CH",IDT,X1))
IF '$DATA(^LRO(68,"AC",LRDFN,IDT,X1))
SET ^(X1)=""
+4 KILL ^TMP("LR",$JOB,"T")
+5 QUIT
+6 ;
+7 ;
UPDT(LWL,ISQN) ; Set/update date/time this entry in LAH has data added.
+1 ; Used by clear instrument data option to allow selective clearing based on date/time criteria.
+2 ; Call with LWL = ien of load/list in LAH
+3 ; ISQN = ien of sequence
+4 NEW LANOW,LAX
+5 ;
+6 SET LANOW=$$NOW^XLFDT
+7 SET LAX=$PIECE($GET(^LAH(LWL,1,ISQN,0)),"^",10,11)
+8 ;
+9 ; Created date/time_"^"_update date/time.
+10 SET LAX=$SELECT($PIECE(LAX,"^",1):$PIECE(LAX,"^",1),1:LANOW)_"^"_LANOW
+11 SET $PIECE(^LAH(LWL,1,ISQN,0),"^",10,11)=LAX
+12 QUIT
+13 ;
+14 ;
UID(LWL,ISQN,UID) ; Set .3 node and "U" xref with accession's UID.
+1 ; Used to verify by unique identifier (UID).
+2 ; Call with LWL = ien of load/list in LAH
+3 ; ISQN = ien of sequence
+4 ; UID = accession's UID
+5 ; Called from above, LRVR1, LRVRW
+6 ;
+7 NEW X
+8 ;
+9 SET X=$PIECE($GET(^LAH(LWL,1,ISQN,.3)),"^")
+10 ; Kill x-ref if existing value different than new value.
+11 IF X]""
IF X'=UID
KILL ^LAH(LWL,1,"U",X,ISQN)
+12 ;
+13 SET $PIECE(^LAH(LWL,1,ISQN,.3),"^")=UID
+14 SET ^LAH(LWL,1,"U",UID,ISQN)=""
+15 QUIT
+16 ;
+17 ;
POI(LWL,ISQN,NODE,LAID) ; Set .1 node with patient/order info
+1 ; Call with LWL = ien of load/list in LAH
+2 ; ISQN = ien of sequence
+3 ; NODE = node to store data on (PID, OBR)
+4 ; LAID = array containing values
+5 ; PID - "DFN","DOB","ICN","LRDFN","LRTDFN","PNM","SEX","SSN"
+6 ; OBR - "EOL","FID","ORCDT","ORDNLT","ORDP","PON","SID","PEB","PVB"
+7 ;
+8 ; ^LAH(LWL,1,ISQN,.1,"OBR","EOL") = enterer's ordering location
+9 ; ^LAH(LWL,1,ISQN,.1,"OBR","FID") = filler specimen id
+10 ; ^LAH(LWL,1,ISQN,.1,"OBR","ORCDT") = order date/time (FileMan d/t)
+11 ; ^LAH(LWL,1,ISQN,.1,"OBR","ORDNLT") = order NLT (multiple separated by "^")
+12 ; ^LAH(LWL,1,ISQN,.1,"OBR","ORDP") = ordering provider (DUZ or id^last name, first name, mi [id])
+13 ; ^LAH(LWL,1,ISQN,.1,"OBR","PEB") = placer entered by (DUZ or id^last name, first name, mi [id])
+14 ; ^LAH(LWL,1,ISQN,.1,"OBR","PON") = placer order number
+15 ; ^LAH(LWL,1,ISQN,.1,"OBR","PVB") = placer verified by (DUZ or id^last name, first name, mi [id])
+16 ; ^LAH(LWL,1,ISQN,.1,"OBR","SID") = placer specimen id
+17 ; ^LAH(LWL,1,ISQN,.1,"PID","DFN") = patient's DFN in file #2
+18 ; ^LAH(LWL,1,ISQN,.1,"PID","DOB") = date of birth (FileMan d/t)
+19 ; ^LAH(LWL,1,ISQN,.1,"PID","ICN") = patient's ICN
+20 ; ^LAH(LWL,1,ISQN,.1,"PID","LRDFN") = patient's LRDFN in file #63
+21 ; ^LAH(LWL,1,ISQN,.1,"PID","LRTDFN") = patient's LRTDFN in file #67
+22 ; ^LAH(LWL,1,ISQN,.1,"PID","PNM") = patient's name
+23 ; ^LAH(LWL,1,ISQN,.1,"PID","SEX") = patient's sex
+24 ; ^LAH(LWL,1,ISQN,.1,"PID","SSN") = patient's SSN
+25 ;
+26 NEW LAX,LAY,LAZ
+27 ;
+28 SET LAX=""
+29 FOR
SET LAX=$ORDER(LAID(LAX))
IF LAX=""
QUIT
Begin DoDot:1
+30 SET LAY=LAID(LAX)
+31 IF LAY=""
QUIT
+32 SET LAZ=$GET(^LAH(LWL,1,ISQN,.1,NODE,LAX))
+33 IF LAY=LAZ
QUIT
+34 ; Remove old data and cross-references.
+35 IF LAZ'=""
Begin DoDot:2
+36 KILL ^LAH(LWL,1,ISQN,.1,NODE,LAX)
+37 IF $PIECE(LAZ,"^")]""
KILL ^LAH(LWL,1,"A"_LAX,$PIECE(LAZ,"^"),ISQN)
End DoDot:2
+38 ; Set new values and cross-references.
+39 SET ^LAH(LWL,1,ISQN,.1,NODE,LAX)=LAY
+40 IF $PIECE(LAY,"^")'=""
SET ^LAH(LWL,1,"A"_LAX,$PIECE(LAY,"^"),ISQN)=""
End DoDot:1
+41 ;
+42 QUIT
+43 ;
+44 ;
LATYP(LWL,ISQN,LAX) ; Set type of interface for this entry
+1 ; Call with LWL = ien of load/list in LAH
+2 ; ISQN = ien of sequence
+3 ; LAX = type of interface
+4 ;
+5 SET $PIECE(^LAH(LWL,1,ISQN,0),"^",12)=LAX
+6 QUIT
+7 ;
+8 ;
LAMSGID(LWL,ISQN,LAX) ; Set pointer to file #62.49 for this entry.
+1 ; Call with LWL = ien of load/list in LAH
+2 ; ISQN = ien of sequence
+3 ; LAX = ien of entry in file #62.49 that is source of these results
+4 ;
+5 SET $PIECE(^LAH(LWL,1,ISQN,0),"^",13)=LAX
+6 SET ^LAH(LWL,1,ISQN,.01,LAX)=""
+7 QUIT
+8 ;
+9 ;
METH(LWL,ISQN,LAX) ; Save instrument name/method for this entry
+1 ; Call with LWL = ien of load/list in LAH
+2 ; ISQN = ien of sequence
+3 ; LAX = method text
+4 ;
+5 NEW X
+6 SET X=$PIECE(^LAH(LWL,1,ISQN,0),"^",7)
+7 IF X'[LAX
SET X=LAX_";"_X
SET $PIECE(^LAH(LWL,1,ISQN,0),"^",7)=X
+8 QUIT