TIUAUD00 ; SPFO/AJB - AUDIT SIGNED DOCUMENTS ;07/19/22 08:09
;;1.0;TEXT INTEGRATION UTILITIES;**343**;Jun 20, 1997;Build 17
;
Q
EN ;
D HOME^%ZIS,PREP^XGF ; ICR # 3173
D EN^VALM("TIU VIEW FM AUDITS")
D CLEAN^XGF
Q
HDR ;
K VALMHDR S VALMHDR(1)="",VALMHDR(2)=$$CJ^XLFSTR("Signed Documents [Edited]",IOM)
Q
INIT ;
K @VALMAR S VALMCNT=0
I '$D(^TIU(8925,"AUD")) D SET^VALM10(2,$$CJ^XLFSTR("<no entries>",IOM),0),XQORM Q
N ENTRY,PREVIOUS S ENTRY="" F S ENTRY=$O(^TIU(8925,"AUD",ENTRY),-1) Q:'+ENTRY D
. N FLD,NODE0 S NODE0=^TIU(8925,"AUD",ENTRY,0),FLD=$P(NODE0,U,3)
. S PREVIOUS=$O(^TIU(8925,"AUD",ENTRY)) S:+PREVIOUS PREVIOUS=$P($G(^TIU(8925,"AUD",PREVIOUS,0)),U,2)
. D FIELD^DID(8925,FLD,,"LABEL","FLD")
. S VALMCNT=VALMCNT+1,X=""
. S X=$$SETFLD^VALM1(VALMCNT,X,"ENTRY")
. S X=$$SETFLD^VALM1(+NODE0,X,"DOCUMENT")
. N VALUE S VALUE=$$FMTE^XLFDT($P(NODE0,U,2)) I +PREVIOUS,$P(NODE0,U,2)>PREVIOUS S VALUE=VALUE_"*"
. S X=$$SETFLD^VALM1(VALUE,X,"DATE/TIME")
. S X=$$SETFLD^VALM1(FLD("LABEL"),X,"FIELD")
. D SET^VALM10(VALMCNT,X,ENTRY)
D XQORM
Q
SELECT ;
I VALMCNT=0 Q
N SEL S SEL=$S(VALMCNT=1:"1,",+XQORNOD(0):$$LOR(.SEL),1:$P(XQORNOD(0),"=",2)) Q:'+SEL
I '$D(SEL(0)) S SEL(0)=SEL
N END,ZTSAVE S ZTSAVE("SEL")="" W !,IOCUON
D EN^XUTMDEVQ("DISPLAY^TIUAUD00(.SEL)","TIU Audit Display",.ZTSAVE)
Q
BRK ;
I $E(IOST,1,2)="C-" S END=$$FMR("EA","Press <Enter> to continue or '^' to exit ")
Q:END=U
CLS ;
W:$E(IOST,1,2)="C-" @IOF
Q
DISPLAY(SEL) ;
S END=0
D:$E(IOST,1,2)="C-" CLS
N NODE S NODE="" F S NODE=$O(SEL(NODE)) Q:NODE=""!(END=U) S SEL=($L(SEL(NODE),",")-1) N PIECE F PIECE=1:1:SEL D Q:END=U
. N ENTRY,IEN S ENTRY=$P(SEL(NODE),",",PIECE),IEN=$O(@VALMAR@("IDX",ENTRY,""))
. N NODE0 S NODE0=$G(^TIU(8925,"AUD",IEN,0))
. N DTE S DTE=$$FMTE^XLFDT($P(NODE0,U,2))
. N FLD S FLD=$P(NODE0,U,3) D FIELD^DID(8925,FLD,,"LABEL","FLD")
. N RTX S RTX=$S(FLD=2:1,1:0)
. N TTL S TTL=$P(^TIU(8925.1,$P(^TIU(8925,+NODE0,0),U),0),U)
. N USR S USR=$$GET1^DIQ(200,$P(NODE0,U,4),.01)
. N NV S NV=$G(^TIU(8925,"AUD",IEN,3),"<deleted>")
. N OV S OV=$G(^TIU(8925,"AUD",IEN,2),"<null>")
. N LINE,X F X=1:1 S LINE=$P($T(OUTPUT+X),";;",2) Q:LINE="EOM"!(END=U) D
. . D BRK:$Y+4>IOSL Q:END=U W @LINE,!
. Q:END=U
. I 'RTX W ! F X="OV","NV" D BRK:$Y+4>IOSL Q:END=U W ?13,$S(X="NV":"New",1:"Old")," Value: ",@X,! W:X="NV" !
. I +RTX D
. . N NODE F NODE=2.14,3.14 D Q:END=U
. . . D BRK:$Y+4>IOSL Q:END=U W !
. . . D BRK:$Y+4>IOSL Q:END=U W $S(NODE=2.14:$$CJ^XLFSTR("< original REPORT TEXT>",IOM),NODE=3.14:$$CJ^XLFSTR("< updated REPORT TEXT>",IOM))
. . . S LINE=0 F S LINE=$O(^TIU(8925,"AUD",IEN,NODE,LINE)) Q:'+LINE!(END=U) D
. . . . D BRK:$Y+4>IOSL Q:END=U W !
. . . . D BRK:$Y+4>IOSL Q:END=U W ^TIU(8925,"AUD",IEN,NODE,LINE,0)
. . . Q:END=U
. . . D BRK:$Y+4>IOSL Q:END=U W !
. . . D BRK:$Y+4>IOSL Q:END=U W $S(NODE=2.14:$$CJ^XLFSTR("</original REPORT TEXT>",IOM),NODE=3.14:$$CJ^XLFSTR("</updated REPORT TEXT>",IOM)) W:NODE=3.14 !!
. . Q:END=U
. Q:END=U
. I IOSL=24 F Q:$Y+4>IOSL W !
. I $E(IOST,1,2)="C-",$O(SEL(NODE))="",PIECE=SEL S END=$$FMR("EA",IOCUOFF_IORVON_"Press <ENTER> to continue "_IORVOFF)
D INIT ; refresh entries
Q
RTXINF ;
;;""
;;$$CJ^XLFSTR("<original REPORT TEXT>",IOM)
;;EOM
OUTPUT ;
;;?5," Audit Entry #: ",ENTRY
;;?5,"=================================================="
;;?5,"Date/Time of Edit: ",DTE
;;?5," Field Edited: ",FLD("LABEL")
;;?5," Document #: ",+NODE0
;;?5," Document Title: ",$E(TTL,1,60)
;;?5," Edited By: ",USR
;;EOM
HTXT ;
;;
;; Detailed View allows you to select one or more entries from the AUDIT data and
;; ouput the information to the desired DEVICE for display or printing.
;;
;; Entries should always be in descending order by Date/Time of Edit.
;; An asterisk (*) with the Date/Time of Edit indicates that audit data has been
;; deleted via programmer mode since these entries will never be removed by TIU
;; or FileMan.
;;EOM
HELP ;
D FULL^VALM1 W @IOF
N LINE,X F X=1:1 S LINE=$P($T(HTXT+X),";;",2) Q:LINE="EOM" D
. W LINE,!
I VALMANS="?" D FMR("EA"," Press <Enter> to continue or '^' to exit. ")
S VALMBCK="R"
Q
EXIT ;
D XQORM,FULL^VALM1
Q
XQORM ;
S XQORM("#")=$O(^ORD(101,"B","TIU FM AUDIT VIEW",0))_U_"1:"_VALMCNT
Q
EXPND ;
Q
FMR(DIR,PRM,DEF,HLP,SCR) ; fileman reader
N DILN,DILOCKTM,DISYS
N DIROUT,DIRUT,DTOUT,DUOUT,X,Y
S DIR(0)=DIR S:$G(PRM)'="" DIR("A")=PRM S:$G(DEF)'="" DIR("B")=DEF S:$G(SCR)'="" DIR("S")=SCR
I $G(HLP)'="" S DIR("?")=HLP
I $D(HLP) M DIR=HLP
W $G(IOCUON) D ^DIR W $G(IOCUOFF)
Q $S($D(DIROUT):U,$D(DIRUT):U,$D(DTOUT):U,$D(DUOUT):U,1:Y)
LOR(SEL) ; list or range of numbers
N DIR,X,Y
S DIR(0)="LOA^1:"_VALMCNT_":0",DIR("A")="Select one or more ENTRIES (1-"_VALMCNT_"): "
S DIR("?")="Enter a list or range of numbers from 1 to "_VALMCNT
D ^DIR
M SEL=Y
Q SEL
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HTIUAUD00 4966 printed Oct 16, 2024@18:39:34 Page 2
TIUAUD00 ; SPFO/AJB - AUDIT SIGNED DOCUMENTS ;07/19/22 08:09
+1 ;;1.0;TEXT INTEGRATION UTILITIES;**343**;Jun 20, 1997;Build 17
+2 ;
+3 QUIT
EN ;
+1 ; ICR # 3173
DO HOME^%ZIS
DO PREP^XGF
+2 DO EN^VALM("TIU VIEW FM AUDITS")
+3 DO CLEAN^XGF
+4 QUIT
HDR ;
+1 KILL VALMHDR
SET VALMHDR(1)=""
SET VALMHDR(2)=$$CJ^XLFSTR("Signed Documents [Edited]",IOM)
+2 QUIT
INIT ;
+1 KILL @VALMAR
SET VALMCNT=0
+2 IF '$DATA(^TIU(8925,"AUD"))
DO SET^VALM10(2,$$CJ^XLFSTR("<no entries>",IOM),0)
DO XQORM
QUIT
+3 NEW ENTRY,PREVIOUS
SET ENTRY=""
FOR
SET ENTRY=$ORDER(^TIU(8925,"AUD",ENTRY),-1)
if '+ENTRY
QUIT
Begin DoDot:1
+4 NEW FLD,NODE0
SET NODE0=^TIU(8925,"AUD",ENTRY,0)
SET FLD=$PIECE(NODE0,U,3)
+5 SET PREVIOUS=$ORDER(^TIU(8925,"AUD",ENTRY))
if +PREVIOUS
SET PREVIOUS=$PIECE($GET(^TIU(8925,"AUD",PREVIOUS,0)),U,2)
+6 DO FIELD^DID(8925,FLD,,"LABEL","FLD")
+7 SET VALMCNT=VALMCNT+1
SET X=""
+8 SET X=$$SETFLD^VALM1(VALMCNT,X,"ENTRY")
+9 SET X=$$SETFLD^VALM1(+NODE0,X,"DOCUMENT")
+10 NEW VALUE
SET VALUE=$$FMTE^XLFDT($PIECE(NODE0,U,2))
IF +PREVIOUS
IF $PIECE(NODE0,U,2)>PREVIOUS
SET VALUE=VALUE_"*"
+11 SET X=$$SETFLD^VALM1(VALUE,X,"DATE/TIME")
+12 SET X=$$SETFLD^VALM1(FLD("LABEL"),X,"FIELD")
+13 DO SET^VALM10(VALMCNT,X,ENTRY)
End DoDot:1
+14 DO XQORM
+15 QUIT
SELECT ;
+1 IF VALMCNT=0
QUIT
+2 NEW SEL
SET SEL=$SELECT(VALMCNT=1:"1,",+XQORNOD(0):$$LOR(.SEL),1:$PIECE(XQORNOD(0),"=",2))
if '+SEL
QUIT
+3 IF '$DATA(SEL(0))
SET SEL(0)=SEL
+4 NEW END,ZTSAVE
SET ZTSAVE("SEL")=""
WRITE !,IOCUON
+5 DO EN^XUTMDEVQ("DISPLAY^TIUAUD00(.SEL)","TIU Audit Display",.ZTSAVE)
+6 QUIT
BRK ;
+1 IF $EXTRACT(IOST,1,2)="C-"
SET END=$$FMR("EA","Press <Enter> to continue or '^' to exit ")
+2 if END=U
QUIT
CLS ;
+1 if $EXTRACT(IOST,1,2)="C-"
WRITE @IOF
+2 QUIT
DISPLAY(SEL) ;
+1 SET END=0
+2 if $EXTRACT(IOST,1,2)="C-"
DO CLS
+3 NEW NODE
SET NODE=""
FOR
SET NODE=$ORDER(SEL(NODE))
if NODE=""!(END=U)
QUIT
SET SEL=($LENGTH(SEL(NODE),",")-1)
NEW PIECE
FOR PIECE=1:1:SEL
Begin DoDot:1
+4 NEW ENTRY,IEN
SET ENTRY=$PIECE(SEL(NODE),",",PIECE)
SET IEN=$ORDER(@VALMAR@("IDX",ENTRY,""))
+5 NEW NODE0
SET NODE0=$GET(^TIU(8925,"AUD",IEN,0))
+6 NEW DTE
SET DTE=$$FMTE^XLFDT($PIECE(NODE0,U,2))
+7 NEW FLD
SET FLD=$PIECE(NODE0,U,3)
DO FIELD^DID(8925,FLD,,"LABEL","FLD")
+8 NEW RTX
SET RTX=$SELECT(FLD=2:1,1:0)
+9 NEW TTL
SET TTL=$PIECE(^TIU(8925.1,$PIECE(^TIU(8925,+NODE0,0),U),0),U)
+10 NEW USR
SET USR=$$GET1^DIQ(200,$PIECE(NODE0,U,4),.01)
+11 NEW NV
SET NV=$GET(^TIU(8925,"AUD",IEN,3),"<deleted>")
+12 NEW OV
SET OV=$GET(^TIU(8925,"AUD",IEN,2),"<null>")
+13 NEW LINE,X
FOR X=1:1
SET LINE=$PIECE($TEXT(OUTPUT+X),";;",2)
if LINE="EOM"!(END=U)
QUIT
Begin DoDot:2
+14 if $Y+4>IOSL
DO BRK
if END=U
QUIT
WRITE @LINE,!
End DoDot:2
+15 if END=U
QUIT
+16 IF 'RTX
WRITE !
FOR X="OV","NV"
if $Y+4>IOSL
DO BRK
if END=U
QUIT
WRITE ?13,$SELECT(X="NV":"New",1:"Old")," Value: ",@X,!
if X="NV"
WRITE !
+17 IF +RTX
Begin DoDot:2
+18 NEW NODE
FOR NODE=2.14,3.14
Begin DoDot:3
+19 if $Y+4>IOSL
DO BRK
if END=U
QUIT
WRITE !
+20 if $Y+4>IOSL
DO BRK
if END=U
QUIT
WRITE $SELECT(NODE=2.14:$$CJ^XLFSTR("< original REPORT TEXT>",IOM),NODE=3.14:$$CJ^XLFSTR("< updated REPORT TEXT>",IOM))
+21 SET LINE=0
FOR
SET LINE=$ORDER(^TIU(8925,"AUD",IEN,NODE,LINE))
if '+LINE!(END=U)
QUIT
Begin DoDot:4
+22 if $Y+4>IOSL
DO BRK
if END=U
QUIT
WRITE !
+23 if $Y+4>IOSL
DO BRK
if END=U
QUIT
WRITE ^TIU(8925,"AUD",IEN,NODE,LINE,0)
End DoDot:4
+24 if END=U
QUIT
+25 if $Y+4>IOSL
DO BRK
if END=U
QUIT
WRITE !
+26 if $Y+4>IOSL
DO BRK
if END=U
QUIT
WRITE $SELECT(NODE=2.14:$$CJ^XLFSTR("</original REPORT TEXT>",IOM),NODE=3.14:$$CJ^XLFSTR("</updated REPORT TEXT>",IOM))
if NODE=3.14
WRITE !!
End DoDot:3
if END=U
QUIT
+27 if END=U
QUIT
End DoDot:2
+28 if END=U
QUIT
+29 IF IOSL=24
FOR
if $Y+4>IOSL
QUIT
WRITE !
+30 IF $EXTRACT(IOST,1,2)="C-"
IF $ORDER(SEL(NODE))=""
IF PIECE=SEL
SET END=$$FMR("EA",IOCUOFF_IORVON_"Press <ENTER> to continue "_IORVOFF)
End DoDot:1
if END=U
QUIT
+31 ; refresh entries
DO INIT
+32 QUIT
RTXINF ;
+1 ;;""
+2 ;;$$CJ^XLFSTR("<original REPORT TEXT>",IOM)
+3 ;;EOM
OUTPUT ;
+1 ;;?5," Audit Entry #: ",ENTRY
+2 ;;?5,"=================================================="
+3 ;;?5,"Date/Time of Edit: ",DTE
+4 ;;?5," Field Edited: ",FLD("LABEL")
+5 ;;?5," Document #: ",+NODE0
+6 ;;?5," Document Title: ",$E(TTL,1,60)
+7 ;;?5," Edited By: ",USR
+8 ;;EOM
HTXT ;
+1 ;;
+2 ;; Detailed View allows you to select one or more entries from the AUDIT data and
+3 ;; ouput the information to the desired DEVICE for display or printing.
+4 ;;
+5 ;; Entries should always be in descending order by Date/Time of Edit.
+6 ;; An asterisk (*) with the Date/Time of Edit indicates that audit data has been
+7 ;; deleted via programmer mode since these entries will never be removed by TIU
+8 ;; or FileMan.
+9 ;;EOM
HELP ;
+1 DO FULL^VALM1
WRITE @IOF
+2 NEW LINE,X
FOR X=1:1
SET LINE=$PIECE($TEXT(HTXT+X),";;",2)
if LINE="EOM"
QUIT
Begin DoDot:1
+3 WRITE LINE,!
End DoDot:1
+4 IF VALMANS="?"
DO FMR("EA"," Press <Enter> to continue or '^' to exit. ")
+5 SET VALMBCK="R"
+6 QUIT
EXIT ;
+1 DO XQORM
DO FULL^VALM1
+2 QUIT
XQORM ;
+1 SET XQORM("#")=$ORDER(^ORD(101,"B","TIU FM AUDIT VIEW",0))_U_"1:"_VALMCNT
+2 QUIT
EXPND ;
+1 QUIT
FMR(DIR,PRM,DEF,HLP,SCR) ; fileman reader
+1 NEW DILN,DILOCKTM,DISYS
+2 NEW DIROUT,DIRUT,DTOUT,DUOUT,X,Y
+3 SET DIR(0)=DIR
if $GET(PRM)'=""
SET DIR("A")=PRM
if $GET(DEF)'=""
SET DIR("B")=DEF
if $GET(SCR)'=""
SET DIR("S")=SCR
+4 IF $GET(HLP)'=""
SET DIR("?")=HLP
+5 IF $DATA(HLP)
MERGE DIR=HLP
+6 WRITE $GET(IOCUON)
DO ^DIR
WRITE $GET(IOCUOFF)
+7 QUIT $SELECT($DATA(DIROUT):U,$DATA(DIRUT):U,$DATA(DTOUT):U,$DATA(DUOUT):U,1:Y)
LOR(SEL) ; list or range of numbers
+1 NEW DIR,X,Y
+2 SET DIR(0)="LOA^1:"_VALMCNT_":0"
SET DIR("A")="Select one or more ENTRIES (1-"_VALMCNT_"): "
+3 SET DIR("?")="Enter a list or range of numbers from 1 to "_VALMCNT
+4 DO ^DIR
+5 MERGE SEL=Y
+6 QUIT SEL