TIUAUDIT ;SLC/JER - Display audit trail ;4/4/01
;;1.0;TEXT INTEGRATION UTILITIES;**100**;Jun 20, 1997
;;Text Integration Utility;;
;IHS/ITSC/LJF 02/21/2003 changed SSN to HRCN
;
EN ; Option entry
K ^TMP("TIUAUDIT",$J) N TIU
D EN^VALM("TIU DISPLAY AUDIT TRAIL")
K ^TMP("TIUAUDIT",$J)
Q
MAIN ; Control branching
N TIUVIEW S TIUVIEW=$$CANDO^TIULP(TIUDA,"VIEW")
I +TIUVIEW'>0 D Q
. W !!,$C(7),$P(TIUVIEW,U,2),!
. I $$READ^TIUU("EA","RETURN to continue...")
D GET^TIUSRV(TIUDA)
Q
HDR ; Build Header
N TIUDTYP,DFN
; I '$D(TIUPRM0)!'$D(TIUPRM1) D SETPARM^TIULE
D:$D(TIU)'>9 GETTIU^TIULD(.TIU,+TIUDA)
S VALMHDR(1)=$$CENTER^TIULS($P($G(TIU("DOCTYP")),U,2))
S VALMHDR(2)=$$SETREC("HDR")
Q
SETREC(LINE) ; Calls $$SETSTR^VALM1 for each line of ^TMP("TIUAUDIT",$J,
N Y
I LINE="HDR" D
. S Y=$$SETSTR^VALM1($$NAME^TIULS(TIU("PNM"),"LAST,FI MI"),$G(Y),1,15)
. ;
. ;S Y=$$SETSTR^VALM1(TIU("SSN"),$G(Y),16,12) ;IHS/ITSC/LJF 02/21/2003
. S Y=$$SETSTR^VALM1("#"_TIU("HRCN"),$G(Y),16,12) ;IHS/ITSC/LJF 02/21/2003
. ;
. S Y=$$SETSTR^VALM1($P($G(TIU("WARD")),U,2),$G(Y),30,20)
. I +TIU("DOCTYP")=1 D
. . S Y=$$SETSTR^VALM1("Adm: "_$$DATE^TIULS(+TIU("EDT"),"MM/DD/YY"),$G(Y),51,13)
. . S Y=$$SETSTR^VALM1("Dis: "_$$DATE^TIULS(+TIU("LDT"),"MM/DD/YY"),$G(Y),66,13)
. I +TIU("DOCTYP")'=1 D
. . S Y=$$SETSTR^VALM1("Visit Date: "_$$DATE^TIULS(+TIU("EDT"),"MM/DD/YY@HR:MIN"),$G(Y),53,26)
Q Y
;
CLEAN ; Die, filthy spawn!!!
D CLEAN^VALM10 K VALMHDR,TIU,TIUPRM0,TIUPRM1
Q
TIUAUDIT ;SLC/JER - Display audit trail ;4/4/01
+1 ;;1.0;TEXT INTEGRATION UTILITIES;**100**;Jun 20, 1997
+2 ;;Text Integration Utility;;
+3 ;IHS/ITSC/LJF 02/21/2003 changed SSN to HRCN
+4 ;
EN ; Option entry
+1 KILL ^TMP("TIUAUDIT",$JOB)
NEW TIU
+2 DO EN^VALM("TIU DISPLAY AUDIT TRAIL")
+3 KILL ^TMP("TIUAUDIT",$JOB)
+4 QUIT
MAIN ; Control branching
+1 NEW TIUVIEW
SET TIUVIEW=$$CANDO^TIULP(TIUDA,"VIEW")
+2 IF +TIUVIEW'>0
Begin DoDot:1
+3 WRITE !!,$CHAR(7),$PIECE(TIUVIEW,U,2),!
+4 IF $$READ^TIUU("EA","RETURN to continue...")
End DoDot:1
QUIT
+5 DO GET^TIUSRV(TIUDA)
+6 QUIT
HDR ; Build Header
+1 NEW TIUDTYP,DFN
+2 ; I '$D(TIUPRM0)!'$D(TIUPRM1) D SETPARM^TIULE
+3 IF $DATA(TIU)'>9
DO GETTIU^TIULD(.TIU,+TIUDA)
+4 SET VALMHDR(1)=$$CENTER^TIULS($PIECE($GET(TIU("DOCTYP")),U,2))
+5 SET VALMHDR(2)=$$SETREC("HDR")
+6 QUIT
SETREC(LINE) ; Calls $$SETSTR^VALM1 for each line of ^TMP("TIUAUDIT",$J,
+1 NEW Y
+2 IF LINE="HDR"
Begin DoDot:1
+3 SET Y=$$SETSTR^VALM1($$NAME^TIULS(TIU("PNM"),"LAST,FI MI"),$GET(Y),1,15)
+4 ;
+5 ;S Y=$$SETSTR^VALM1(TIU("SSN"),$G(Y),16,12) ;IHS/ITSC/LJF 02/21/2003
+6 ;IHS/ITSC/LJF 02/21/2003
SET Y=$$SETSTR^VALM1("#"_TIU("HRCN"),$GET(Y),16,12)
+7 ;
+8 SET Y=$$SETSTR^VALM1($PIECE($GET(TIU("WARD")),U,2),$GET(Y),30,20)
+9 IF +TIU("DOCTYP")=1
Begin DoDot:2
+10 SET Y=$$SETSTR^VALM1("Adm: "_$$DATE^TIULS(+TIU("EDT"),"MM/DD/YY"),$GET(Y),51,13)
+11 SET Y=$$SETSTR^VALM1("Dis: "_$$DATE^TIULS(+TIU("LDT"),"MM/DD/YY"),$GET(Y),66,13)
End DoDot:2
+12 IF +TIU("DOCTYP")'=1
Begin DoDot:2
+13 SET Y=$$SETSTR^VALM1("Visit Date: "_$$DATE^TIULS(+TIU("EDT"),"MM/DD/YY@HR:MIN"),$GET(Y),53,26)
End DoDot:2
End DoDot:1
+14 QUIT Y
+15 ;
CLEAN ; Die, filthy spawn!!!
+1 DO CLEAN^VALM10
KILL VALMHDR,TIU,TIUPRM0,TIUPRM1
+2 QUIT