LRMIAUD ;DALISC/RBN - Micro Audit/Alert System ;July 22, 2008
;;5.2;LAB SERVICE;**350**;Sep 27, 1994;Build 230
;
; This routine is a shell to fit into the
; proposed framework for LR*5.2*216
;
; NOTE: All Auditing routines assume that the caller already has the appropriate global lock(s) before entry.
; L +^LR(LRDFN,"MI",LRIDT)
;
; ^LR data that is temporarily changed should all be changed in one spot. Also an error trap should be setup
; so the changed data can be restored if an error happens between changing the data and restoring the data
;
Q
;
;
LEDI(IN) ;
; This entry point is specifically for using the audit log with LDSI/LEDI lab results received via HL7 from a host lab.
;
; Input
; IN : <byref><opt> Pass info to Audit trail
; : IN(63.539,3) = #63.539 field #3 (dflt=1)
; : IN(63.539,4) = #63.539 field #4 (dflt=UPDATED BY HOST)
; Output : Returns the IEN of the new #63.539 entry
;
N X,LRNOW,LRAUDTMP,LREDT,LR63539,DATA,ZDUZP
;
Q:$G(LRSB)'>0 0
I LRSB'=.99,'$D(^LR(LRDFN,"MI",LRIDT,LRSB)) Q 0
;
S ZDUZP=$S(LRSB=1:4,LRSB=5:3,LRSB=8:4,LRSB=11:5,1:"")
I LRSB'=.99 Q:'ZDUZP 0
S (LREDT,LRNOW)=$$NOW^XLFDT
; logic from proposed MI audit trail should audit trail really be setting these fields since
; audit trail gets triggered even when data doesnt change?
;I ZDUZP D ;
;. N LRDFA,LRIEN,LRMSG,DIERR,FLD,FLDS
;. I LRSB=1 S FLDS(11)=LRNOW S FLDS(11.55)=DUZ
;. I LRSB=5 S FLDS(14)=LRNOW S FLDS(15.5)=DUZ
;. I LRSB=8 S FLDS(18)=LRNOW S FLDS(19.5)=DUZ
;. I LRSB=11 S FLDS(22)=LRNOW S FLDS(25.5)=DUZ
;. Q:'$D(FLDS)
;. S LRIEN=LRIDT_","_LRDFN_","
;. S FLD=""
;. F S FLD=$O(FLDS(FLD)) Q:FLD="" D ;
;. . S LRFDA(1,63.05,LRIEN,FLD)=FLDS(FLD)
;. Q:'$D(LRFDA)
;. D FILE^DIE("","LRFDA(1)","LRMSG")
;. ;original LR*216 proposed code was setting these
;. ;S $P(^LR(LRDFN,"MI",LRIDT,LRSB),U,1)=LRNOW
;. ;S $P(^LR(LRDFN,"MI",LRIDT,LRSB),U,ZDUZP)=DUZ
;
K DATA
S DATA(63.539,3)=$G(IN(63.539,3),1)
S DATA(63.539,4)=$G(IN(63.539,4),"UPDATED BY HOST LAB VIA HL7")
S LR63539=$$FILEAUD^LRMIAU1(.DATA)
Q LR63539
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLRMIAUD 2136 printed Nov 22, 2024@17:27 Page 2
LRMIAUD ;DALISC/RBN - Micro Audit/Alert System ;July 22, 2008
+1 ;;5.2;LAB SERVICE;**350**;Sep 27, 1994;Build 230
+2 ;
+3 ; This routine is a shell to fit into the
+4 ; proposed framework for LR*5.2*216
+5 ;
+6 ; NOTE: All Auditing routines assume that the caller already has the appropriate global lock(s) before entry.
+7 ; L +^LR(LRDFN,"MI",LRIDT)
+8 ;
+9 ; ^LR data that is temporarily changed should all be changed in one spot. Also an error trap should be setup
+10 ; so the changed data can be restored if an error happens between changing the data and restoring the data
+11 ;
+12 QUIT
+13 ;
+14 ;
LEDI(IN) ;
+1 ; This entry point is specifically for using the audit log with LDSI/LEDI lab results received via HL7 from a host lab.
+2 ;
+3 ; Input
+4 ; IN : <byref><opt> Pass info to Audit trail
+5 ; : IN(63.539,3) = #63.539 field #3 (dflt=1)
+6 ; : IN(63.539,4) = #63.539 field #4 (dflt=UPDATED BY HOST)
+7 ; Output : Returns the IEN of the new #63.539 entry
+8 ;
+9 NEW X,LRNOW,LRAUDTMP,LREDT,LR63539,DATA,ZDUZP
+10 ;
+11 if $GET(LRSB)'>0
QUIT 0
+12 IF LRSB'=.99
IF '$DATA(^LR(LRDFN,"MI",LRIDT,LRSB))
QUIT 0
+13 ;
+14 SET ZDUZP=$SELECT(LRSB=1:4,LRSB=5:3,LRSB=8:4,LRSB=11:5,1:"")
+15 IF LRSB'=.99
if 'ZDUZP
QUIT 0
+16 SET (LREDT,LRNOW)=$$NOW^XLFDT
+17 ; logic from proposed MI audit trail should audit trail really be setting these fields since
+18 ; audit trail gets triggered even when data doesnt change?
+19 ;I ZDUZP D ;
+20 ;. N LRDFA,LRIEN,LRMSG,DIERR,FLD,FLDS
+21 ;. I LRSB=1 S FLDS(11)=LRNOW S FLDS(11.55)=DUZ
+22 ;. I LRSB=5 S FLDS(14)=LRNOW S FLDS(15.5)=DUZ
+23 ;. I LRSB=8 S FLDS(18)=LRNOW S FLDS(19.5)=DUZ
+24 ;. I LRSB=11 S FLDS(22)=LRNOW S FLDS(25.5)=DUZ
+25 ;. Q:'$D(FLDS)
+26 ;. S LRIEN=LRIDT_","_LRDFN_","
+27 ;. S FLD=""
+28 ;. F S FLD=$O(FLDS(FLD)) Q:FLD="" D ;
+29 ;. . S LRFDA(1,63.05,LRIEN,FLD)=FLDS(FLD)
+30 ;. Q:'$D(LRFDA)
+31 ;. D FILE^DIE("","LRFDA(1)","LRMSG")
+32 ;. ;original LR*216 proposed code was setting these
+33 ;. ;S $P(^LR(LRDFN,"MI",LRIDT,LRSB),U,1)=LRNOW
+34 ;. ;S $P(^LR(LRDFN,"MI",LRIDT,LRSB),U,ZDUZP)=DUZ
+35 ;
+36 KILL DATA
+37 SET DATA(63.539,3)=$GET(IN(63.539,3),1)
+38 SET DATA(63.539,4)=$GET(IN(63.539,4),"UPDATED BY HOST LAB VIA HL7")
+39 SET LR63539=$$FILEAUD^LRMIAU1(.DATA)
+40 QUIT LR63539