DGENUPA1 ;ALB/CJM - UPLOAD AUDIT ; 04-APR-94
;;5.3;REGISTRATION;**147,222,232,1015**;Aug 13,1993;Build 21
;
AUDIT(ERROR,MSGID,OLDPAT,NEWPAT,OLDELG,NEWELG,OLDCDIS,NEWCDIS,NEWSEC,OLDSEC) ;
;Description: creates an audit trail for an upload.
;
;Input:
;Output:
; Function Value: 1 on sucess, 0 on failure
; ERROR - error message (optional, pass by reference)
N AUDIT
D CREATE^DGENUPA(OLDPAT("DFN"),,MSGID,.AUDIT)
D PAT
D ELIG
D ELGCODES
D RDISB
D CDIS
D SEC
Q +$$STORE^DGENUPA(.AUDIT,.ERROR)
;
ELIG ;
;Description: Changes for Eligibility object (other than multiples)
N FIELD,LINE,IEN,HDR
S HDR=0
I OLDELG("ELIG","CODE")'=NEWELG("ELIG","CODE") D
.;
.S LINE=$$LJ^XLFSTR("PRIMRY ELIG: ",15)_$$LJ^XLFSTR($$EXT^DGENELA3("CODE",OLDELG("ELIG","CODE")),33)_" "_$$EXT^DGENELA3("CODE",NEWELG("ELIG","CODE"))
.I 'HDR D ELGHDR
.D ADDCHNG^DGENUPA(.AUDIT,LINE)
;
S FIELD=""
F S FIELD=$O(OLDELG(FIELD)) Q:(FIELD="") D
.Q:((FIELD="ELIG")!(FIELD="RATEDIS")!(FIELD="MTSTA")!(FIELD="DFN")) ;MT Status not uploaded
.I OLDELG(FIELD)'=NEWELG(FIELD) D
..;
..S LINE=$$LJ^XLFSTR(FIELD_": ",15)_$$LJ^XLFSTR($$EXT^DGENELA3(FIELD,OLDELG(FIELD)),33)_" "_$$EXT^DGENELA3(FIELD,NEWELG(FIELD))
..I 'HDR D ELGHDR
..D ADDCHNG^DGENUPA(.AUDIT,LINE)
Q
;
ELGHDR ;
;Description: Header for changes in ELIGIBILITY object
;
D ADDCHNG^DGENUPA(.AUDIT," ")
D ADDCHNG^DGENUPA(.AUDIT," Patient Eligibility")
D ADDCHNG^DGENUPA(.AUDIT,"Field Before After")
D ADDCHNG^DGENUPA(.AUDIT,"=============================================================================")
S HDR=1
Q
;
ELGCODES ;
;Description: Changes in Patient Eligibilities
;
N FIELD,LINE,IEN,HDR
S HDR=0
S IEN=0
F S IEN=$O(NEWELG("ELIG","CODE",IEN)) Q:'IEN I '$G(OLDELG("ELIG","CODE",IEN)) D
.D:'HDR AELGHDR
.D ADDCHNG^DGENUPA(.AUDIT," "_$$EXT^DGENELA3("CODE",IEN))
;
S HDR=0
S IEN=0
F S IEN=$O(OLDELG("ELIG","CODE",IEN)) Q:'IEN I '$G(NEWELG("ELIG","CODE",IEN)) D
.;
.;the new primary eligibility code will be placed in the eligibilities multiple via the x-ref
.Q:(OLDELG("ELIG","CODE",IEN)=NEWELG("ELIG","CODE"))
.;
.D:'HDR DELGHDR
.D ADDCHNG^DGENUPA(.AUDIT," "_$$EXT^DGENELA3("CODE",IEN))
;
Q
;
AELGHDR ;
;Description: Header for eligibility codes added
;
D ADDCHNG^DGENUPA(.AUDIT," ")
D ADDCHNG^DGENUPA(.AUDIT,"Patient Eligibilities Added:")
S HDR=1
Q
;
DELGHDR ;
;Description: Header for eligibility codes deleted
;
D ADDCHNG^DGENUPA(.AUDIT," ")
D ADDCHNG^DGENUPA(.AUDIT,"Patient Eligibilities Deleted:")
S HDR=1
Q
;
RDISB ;
;Description: Changes in Rated Disabilities
;
N COUNT,NEWDIBS,OLDDIBS,IEN,PER,SC,HDR
;set up the rated disabilities in a more useful format to detect changes
S COUNT=0
F S COUNT=$O(NEWELG("RATEDIS",COUNT)) Q:'COUNT S NEWDIBS(+NEWELG("RATEDIS",COUNT,"RD"),+NEWELG("RATEDIS",COUNT,"PER"),$J(NEWELG("RATEDIS",COUNT,"RDSC"),1))=""
S COUNT=0
F S COUNT=$O(OLDELG("RATEDIS",COUNT)) Q:'COUNT S OLDDIBS(+OLDELG("RATEDIS",COUNT,"RD"),+OLDELG("RATEDIS",COUNT,"PER"),$J(OLDELG("RATEDIS",COUNT,"RDSC"),1))=""
;
;find disabilty taht have been added
S HDR=0
S IEN=0
F S IEN=$O(NEWDIBS(IEN)) Q:'IEN D
.S PER=""
.F S PER=$O(NEWDIBS(IEN,PER)) Q:(PER="") D
..S SC=""
..F S SC=$O(NEWDIBS(IEN,PER,SC)) Q:(SC="") D
...I '$D(OLDDIBS(IEN,PER,SC)) D
....D:'HDR ARDISHDR
....D ADDCHNG^DGENUPA(.AUDIT," "_$$LJ^XLFSTR($$EXT^DGENELA3("RD",IEN),45)_" Percent: "_PER_" SC: "_$$EXT^DGENELA3("RDSC",SC))
;
;find disabilities that have been deleted
S HDR=0
S IEN=0
F S IEN=$O(OLDDIBS(IEN)) Q:'IEN D
.S PER=""
.F S PER=$O(OLDDIBS(IEN,PER)) Q:(PER="") D
..S SC=""
..F S SC=$O(OLDDIBS(IEN,PER,SC)) Q:(SC="") D
...I '$D(NEWDIBS(IEN,PER,SC)) D
....D:'HDR DRDISHDR
....D ADDCHNG^DGENUPA(.AUDIT," "_$$LJ^XLFSTR($$EXT^DGENELA3("RD",IEN),45)_" Percent: "_PER_" SC: "_$$EXT^DGENELA3("RDSC",SC))
Q
;
DRDISHDR ;
;Description: Header for deleted disabilities
;
D ADDCHNG^DGENUPA(.AUDIT," ")
D ADDCHNG^DGENUPA(.AUDIT,"Rated Disabilities Deleted:")
S HDR=1
Q
;
ARDISHDR ;
;Description: Header for added disabilities
;
D ADDCHNG^DGENUPA(.AUDIT," ")
D ADDCHNG^DGENUPA(.AUDIT,"Rated Disabilities Added:")
S HDR=1
Q
;
PAT ;
;Description: Changes in PATIENT object
;
N FIELD,LINE,IEN,HDR
S HDR=0
S FIELD=""
F S FIELD=$O(OLDPAT(FIELD)) Q:(FIELD="") D
.Q:((FIELD="DFN")) ;
.I OLDPAT(FIELD)'=NEWPAT(FIELD) D
..;
..I 'HDR D PATHDR
..I FIELD="DEATH" S LINE="** ALERT ONLY: Changes to Date of Death are NOT automatically updated **" D ADDCHNG^DGENUPA(.AUDIT,LINE)
..S LINE=$$LJ^XLFSTR(FIELD_": ",15)_$$LJ^XLFSTR($$EXT^DGENPTA(FIELD,OLDPAT(FIELD)),33)_" "_$$EXT^DGENPTA(FIELD,NEWPAT(FIELD))
..D ADDCHNG^DGENUPA(.AUDIT,LINE)
Q
;
PATHDR ;
;Descripition: Header for changes in PATIENT object
;
D ADDCHNG^DGENUPA(.AUDIT," Patient Demographics")
D ADDCHNG^DGENUPA(.AUDIT,"Field Before After")
D ADDCHNG^DGENUPA(.AUDIT,"=============================================================================")
S HDR=1
Q
;
CDIS ;
;Description: Changes in CATASTROPHIC DISABILTY object
;
N SUBFIELD,FIELD,LINE,IEN,HDR
S HDR=0
S FIELD=""
F S FIELD=$O(OLDCDIS(FIELD)) Q:(FIELD="") D
.I $D(OLDCDIS(FIELD))'=1 Q
.I OLDCDIS(FIELD)'=NEWCDIS(FIELD) D
..S LINE=$$LJ^XLFSTR(FIELD_": ",15)_$$LJ^XLFSTR($$EXT^DGENCDU(FIELD,OLDCDIS(FIELD)),33)_" "_$$EXT^DGENCDU(FIELD,NEWCDIS(FIELD))
..I 'HDR D CDISHDR
..D ADDCHNG^DGENUPA(.AUDIT,LINE)
F FIELD="SCORE","PROC","PERM","EXT","DIAG","COND" D
.F SUBFIELD=1:1 Q:('$D(OLDCDIS(FIELD,SUBFIELD)))&('$D(NEWCDIS(FIELD,SUBFIELD))) D
..I $G(OLDCDIS(FIELD,SUBFIELD))'=$G(NEWCDIS(FIELD,SUBFIELD)) D
...S LINE=$$LJ^XLFSTR(FIELD_": ",15)
...S LINE=LINE_$$LJ^XLFSTR($S($G(OLDCDIS(FIELD,SUBFIELD))'="":$$EXT^DGENCDU(FIELD,OLDCDIS(FIELD,SUBFIELD)),1:""),33)
...S LINE=LINE_" "_$S($G(NEWCDIS(FIELD,SUBFIELD))'="":$$EXT^DGENCDU(FIELD,NEWCDIS(FIELD,SUBFIELD)),1:"")
...I 'HDR D CDISHDR
...D ADDCHNG^DGENUPA(.AUDIT,LINE)
Q
;
CDISHDR ;
;Descripition: Header for changes in CATASTROPHIC DISABILTY object
;
D ADDCHNG^DGENUPA(.AUDIT," ")
D ADDCHNG^DGENUPA(.AUDIT," Catastrophic Disability")
D ADDCHNG^DGENUPA(.AUDIT,"Field Before After")
D ADDCHNG^DGENUPA(.AUDIT,"=============================================================================")
S HDR=1
Q
;
SEC ;
; Description: Changes in PATIENT SECURITY object
;
N FIELD,LINE,IEN,HDR
S HDR=0
S FIELD=""
F S FIELD=$O(OLDSEC(FIELD)) Q:(FIELD="") D
.;
.Q:((FIELD="DFN")) ; do not need to audit this field
.I OLDSEC(FIELD)'=NEWSEC(FIELD) D
..;
..S LINE=$$LJ^XLFSTR(FIELD_": ",15)_$$LJ^XLFSTR($$EXT^DGENSEC(FIELD,OLDSEC(FIELD)),33)_" "_$$EXT^DGENSEC(FIELD,NEWSEC(FIELD))
..I 'HDR D SECHDR
..D ADDCHNG^DGENUPA(.AUDIT,LINE)
;
Q
;
SECHDR ;
; Description: Header for changes in PATIENT SECURITY object
;
D ADDCHNG^DGENUPA(.AUDIT," ")
D ADDCHNG^DGENUPA(.AUDIT," Patient Security")
D ADDCHNG^DGENUPA(.AUDIT,"Field Before After")
D ADDCHNG^DGENUPA(.AUDIT,"=============================================================================")
S HDR=1
Q
DGENUPA1 ;ALB/CJM - UPLOAD AUDIT ; 04-APR-94
+1 ;;5.3;REGISTRATION;**147,222,232,1015**;Aug 13,1993;Build 21
+2 ;
AUDIT(ERROR,MSGID,OLDPAT,NEWPAT,OLDELG,NEWELG,OLDCDIS,NEWCDIS,NEWSEC,OLDSEC) ;
+1 ;Description: creates an audit trail for an upload.
+2 ;
+3 ;Input:
+4 ;Output:
+5 ; Function Value: 1 on sucess, 0 on failure
+6 ; ERROR - error message (optional, pass by reference)
+7 NEW AUDIT
+8 DO CREATE^DGENUPA(OLDPAT("DFN"),,MSGID,.AUDIT)
+9 DO PAT
+10 DO ELIG
+11 DO ELGCODES
+12 DO RDISB
+13 DO CDIS
+14 DO SEC
+15 QUIT +$$STORE^DGENUPA(.AUDIT,.ERROR)
+16 ;
ELIG ;
+1 ;Description: Changes for Eligibility object (other than multiples)
+2 NEW FIELD,LINE,IEN,HDR
+3 SET HDR=0
+4 IF OLDELG("ELIG","CODE")'=NEWELG("ELIG","CODE")
Begin DoDot:1
+5 ;
+6 SET LINE=$$LJ^XLFSTR("PRIMRY ELIG: ",15)_$$LJ^XLFSTR($$EXT^DGENELA3("CODE",OLDELG("ELIG","CODE")),33)_" "_$$EXT^DGENELA3("CODE",NEWELG("ELIG","CODE"))
+7 IF 'HDR
DO ELGHDR
+8 DO ADDCHNG^DGENUPA(.AUDIT,LINE)
End DoDot:1
+9 ;
+10 SET FIELD=""
+11 FOR
SET FIELD=$ORDER(OLDELG(FIELD))
IF (FIELD="")
QUIT
Begin DoDot:1
+12 ;MT Status not uploaded
IF ((FIELD="ELIG")!(FIELD="RATEDIS")!(FIELD="MTSTA")!(FIELD="DFN"))
QUIT
+13 IF OLDELG(FIELD)'=NEWELG(FIELD)
Begin DoDot:2
+14 ;
+15 SET LINE=$$LJ^XLFSTR(FIELD_": ",15)_$$LJ^XLFSTR($$EXT^DGENELA3(FIELD,OLDELG(FIELD)),33)_" "_$$EXT^DGENELA3(FIELD,NEWELG(FIELD))
+16 IF 'HDR
DO ELGHDR
+17 DO ADDCHNG^DGENUPA(.AUDIT,LINE)
End DoDot:2
End DoDot:1
+18 QUIT
+19 ;
ELGHDR ;
+1 ;Description: Header for changes in ELIGIBILITY object
+2 ;
+3 DO ADDCHNG^DGENUPA(.AUDIT," ")
+4 DO ADDCHNG^DGENUPA(.AUDIT," Patient Eligibility")
+5 DO ADDCHNG^DGENUPA(.AUDIT,"Field Before After")
+6 DO ADDCHNG^DGENUPA(.AUDIT,"=============================================================================")
+7 SET HDR=1
+8 QUIT
+9 ;
ELGCODES ;
+1 ;Description: Changes in Patient Eligibilities
+2 ;
+3 NEW FIELD,LINE,IEN,HDR
+4 SET HDR=0
+5 SET IEN=0
+6 FOR
SET IEN=$ORDER(NEWELG("ELIG","CODE",IEN))
IF 'IEN
QUIT
IF '$GET(OLDELG("ELIG","CODE",IEN))
Begin DoDot:1
+7 IF 'HDR
DO AELGHDR
+8 DO ADDCHNG^DGENUPA(.AUDIT," "_$$EXT^DGENELA3("CODE",IEN))
End DoDot:1
+9 ;
+10 SET HDR=0
+11 SET IEN=0
+12 FOR
SET IEN=$ORDER(OLDELG("ELIG","CODE",IEN))
IF 'IEN
QUIT
IF '$GET(NEWELG("ELIG","CODE",IEN))
Begin DoDot:1
+13 ;
+14 ;the new primary eligibility code will be placed in the eligibilities multiple via the x-ref
+15 IF (OLDELG("ELIG","CODE",IEN)=NEWELG("ELIG","CODE"))
QUIT
+16 ;
+17 IF 'HDR
DO DELGHDR
+18 DO ADDCHNG^DGENUPA(.AUDIT," "_$$EXT^DGENELA3("CODE",IEN))
End DoDot:1
+19 ;
+20 QUIT
+21 ;
AELGHDR ;
+1 ;Description: Header for eligibility codes added
+2 ;
+3 DO ADDCHNG^DGENUPA(.AUDIT," ")
+4 DO ADDCHNG^DGENUPA(.AUDIT,"Patient Eligibilities Added:")
+5 SET HDR=1
+6 QUIT
+7 ;
DELGHDR ;
+1 ;Description: Header for eligibility codes deleted
+2 ;
+3 DO ADDCHNG^DGENUPA(.AUDIT," ")
+4 DO ADDCHNG^DGENUPA(.AUDIT,"Patient Eligibilities Deleted:")
+5 SET HDR=1
+6 QUIT
+7 ;
RDISB ;
+1 ;Description: Changes in Rated Disabilities
+2 ;
+3 NEW COUNT,NEWDIBS,OLDDIBS,IEN,PER,SC,HDR
+4 ;set up the rated disabilities in a more useful format to detect changes
+5 SET COUNT=0
+6 FOR
SET COUNT=$ORDER(NEWELG("RATEDIS",COUNT))
IF 'COUNT
QUIT
SET NEWDIBS(+NEWELG("RATEDIS",COUNT,"RD"),+NEWELG("RATEDIS",COUNT,"PER"),$JUSTIFY(NEWELG("RATEDIS",COUNT,"RDSC"),1))=""
+7 SET COUNT=0
+8 FOR
SET COUNT=$ORDER(OLDELG("RATEDIS",COUNT))
IF 'COUNT
QUIT
SET OLDDIBS(+OLDELG("RATEDIS",COUNT,"RD"),+OLDELG("RATEDIS",COUNT,"PER"),$JUSTIFY(OLDELG("RATEDIS",COUNT,"RDSC"),1))=""
+9 ;
+10 ;find disabilty taht have been added
+11 SET HDR=0
+12 SET IEN=0
+13 FOR
SET IEN=$ORDER(NEWDIBS(IEN))
IF 'IEN
QUIT
Begin DoDot:1
+14 SET PER=""
+15 FOR
SET PER=$ORDER(NEWDIBS(IEN,PER))
IF (PER="")
QUIT
Begin DoDot:2
+16 SET SC=""
+17 FOR
SET SC=$ORDER(NEWDIBS(IEN,PER,SC))
IF (SC="")
QUIT
Begin DoDot:3
+18 IF '$DATA(OLDDIBS(IEN,PER,SC))
Begin DoDot:4
+19 IF 'HDR
DO ARDISHDR
+20 DO ADDCHNG^DGENUPA(.AUDIT," "_$$LJ^XLFSTR($$EXT^DGENELA3("RD",IEN),45)_" Percent: "_PER_" SC: "_$$EXT^DGENELA3("RDSC",SC))
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+21 ;
+22 ;find disabilities that have been deleted
+23 SET HDR=0
+24 SET IEN=0
+25 FOR
SET IEN=$ORDER(OLDDIBS(IEN))
IF 'IEN
QUIT
Begin DoDot:1
+26 SET PER=""
+27 FOR
SET PER=$ORDER(OLDDIBS(IEN,PER))
IF (PER="")
QUIT
Begin DoDot:2
+28 SET SC=""
+29 FOR
SET SC=$ORDER(OLDDIBS(IEN,PER,SC))
IF (SC="")
QUIT
Begin DoDot:3
+30 IF '$DATA(NEWDIBS(IEN,PER,SC))
Begin DoDot:4
+31 IF 'HDR
DO DRDISHDR
+32 DO ADDCHNG^DGENUPA(.AUDIT," "_$$LJ^XLFSTR($$EXT^DGENELA3("RD",IEN),45)_" Percent: "_PER_" SC: "_$$EXT^DGENELA3("RDSC",SC))
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+33 QUIT
+34 ;
DRDISHDR ;
+1 ;Description: Header for deleted disabilities
+2 ;
+3 DO ADDCHNG^DGENUPA(.AUDIT," ")
+4 DO ADDCHNG^DGENUPA(.AUDIT,"Rated Disabilities Deleted:")
+5 SET HDR=1
+6 QUIT
+7 ;
ARDISHDR ;
+1 ;Description: Header for added disabilities
+2 ;
+3 DO ADDCHNG^DGENUPA(.AUDIT," ")
+4 DO ADDCHNG^DGENUPA(.AUDIT,"Rated Disabilities Added:")
+5 SET HDR=1
+6 QUIT
+7 ;
PAT ;
+1 ;Description: Changes in PATIENT object
+2 ;
+3 NEW FIELD,LINE,IEN,HDR
+4 SET HDR=0
+5 SET FIELD=""
+6 FOR
SET FIELD=$ORDER(OLDPAT(FIELD))
IF (FIELD="")
QUIT
Begin DoDot:1
+7 ;
IF ((FIELD="DFN"))
QUIT
+8 IF OLDPAT(FIELD)'=NEWPAT(FIELD)
Begin DoDot:2
+9 ;
+10 IF 'HDR
DO PATHDR
+11 IF FIELD="DEATH"
SET LINE="** ALERT ONLY: Changes to Date of Death are NOT automatically updated **"
DO ADDCHNG^DGENUPA(.AUDIT,LINE)
+12 SET LINE=$$LJ^XLFSTR(FIELD_": ",15)_$$LJ^XLFSTR($$EXT^DGENPTA(FIELD,OLDPAT(FIELD)),33)_" "_$$EXT^DGENPTA(FIELD,NEWPAT(FIELD))
+13 DO ADDCHNG^DGENUPA(.AUDIT,LINE)
End DoDot:2
End DoDot:1
+14 QUIT
+15 ;
PATHDR ;
+1 ;Descripition: Header for changes in PATIENT object
+2 ;
+3 DO ADDCHNG^DGENUPA(.AUDIT," Patient Demographics")
+4 DO ADDCHNG^DGENUPA(.AUDIT,"Field Before After")
+5 DO ADDCHNG^DGENUPA(.AUDIT,"=============================================================================")
+6 SET HDR=1
+7 QUIT
+8 ;
CDIS ;
+1 ;Description: Changes in CATASTROPHIC DISABILTY object
+2 ;
+3 NEW SUBFIELD,FIELD,LINE,IEN,HDR
+4 SET HDR=0
+5 SET FIELD=""
+6 FOR
SET FIELD=$ORDER(OLDCDIS(FIELD))
IF (FIELD="")
QUIT
Begin DoDot:1
+7 IF $DATA(OLDCDIS(FIELD))'=1
QUIT
+8 IF OLDCDIS(FIELD)'=NEWCDIS(FIELD)
Begin DoDot:2
+9 SET LINE=$$LJ^XLFSTR(FIELD_": ",15)_$$LJ^XLFSTR($$EXT^DGENCDU(FIELD,OLDCDIS(FIELD)),33)_" "_$$EXT^DGENCDU(FIELD,NEWCDIS(FIELD))
+10 IF 'HDR
DO CDISHDR
+11 DO ADDCHNG^DGENUPA(.AUDIT,LINE)
End DoDot:2
End DoDot:1
+12 FOR FIELD="SCORE","PROC","PERM","EXT","DIAG","COND"
Begin DoDot:1
+13 FOR SUBFIELD=1:1
IF ('$DATA(OLDCDIS(FIELD,SUBFIELD)))&('$DATA(NEWCDIS(FIELD,SUBFIELD)))
QUIT
Begin DoDot:2
+14 IF $GET(OLDCDIS(FIELD,SUBFIELD))'=$GET(NEWCDIS(FIELD,SUBFIELD))
Begin DoDot:3
+15 SET LINE=$$LJ^XLFSTR(FIELD_": ",15)
+16 SET LINE=LINE_$$LJ^XLFSTR($SELECT($GET(OLDCDIS(FIELD,SUBFIELD))'="":$$EXT^DGENCDU(FIELD,OLDCDIS(FIELD,SUBFIELD)),1:""),33)
+17 SET LINE=LINE_" "_$SELECT($GET(NEWCDIS(FIELD,SUBFIELD))'="":$$EXT^DGENCDU(FIELD,NEWCDIS(FIELD,SUBFIELD)),1:"")
+18 IF 'HDR
DO CDISHDR
+19 DO ADDCHNG^DGENUPA(.AUDIT,LINE)
End DoDot:3
End DoDot:2
End DoDot:1
+20 QUIT
+21 ;
CDISHDR ;
+1 ;Descripition: Header for changes in CATASTROPHIC DISABILTY object
+2 ;
+3 DO ADDCHNG^DGENUPA(.AUDIT," ")
+4 DO ADDCHNG^DGENUPA(.AUDIT," Catastrophic Disability")
+5 DO ADDCHNG^DGENUPA(.AUDIT,"Field Before After")
+6 DO ADDCHNG^DGENUPA(.AUDIT,"=============================================================================")
+7 SET HDR=1
+8 QUIT
+9 ;
SEC ;
+1 ; Description: Changes in PATIENT SECURITY object
+2 ;
+3 NEW FIELD,LINE,IEN,HDR
+4 SET HDR=0
+5 SET FIELD=""
+6 FOR
SET FIELD=$ORDER(OLDSEC(FIELD))
IF (FIELD="")
QUIT
Begin DoDot:1
+7 ;
+8 ; do not need to audit this field
IF ((FIELD="DFN"))
QUIT
+9 IF OLDSEC(FIELD)'=NEWSEC(FIELD)
Begin DoDot:2
+10 ;
+11 SET LINE=$$LJ^XLFSTR(FIELD_": ",15)_$$LJ^XLFSTR($$EXT^DGENSEC(FIELD,OLDSEC(FIELD)),33)_" "_$$EXT^DGENSEC(FIELD,NEWSEC(FIELD))
+12 IF 'HDR
DO SECHDR
+13 DO ADDCHNG^DGENUPA(.AUDIT,LINE)
End DoDot:2
End DoDot:1
+14 ;
+15 QUIT
+16 ;
SECHDR ;
+1 ; Description: Header for changes in PATIENT SECURITY object
+2 ;
+3 DO ADDCHNG^DGENUPA(.AUDIT," ")
+4 DO ADDCHNG^DGENUPA(.AUDIT," Patient Security")
+5 DO ADDCHNG^DGENUPA(.AUDIT,"Field Before After")
+6 DO ADDCHNG^DGENUPA(.AUDIT,"=============================================================================")
+7 SET HDR=1
+8 QUIT