DINIT20 ;SFISC/XAK - INITIALIZE VA FILEMAN ;9JAN2016
;;22.2;VA FileMan;**2,14**;Jan 05, 2016;Build 8
;;Per VA Directive 6402, this routine should not be modified.
;;Submitted to OSEHRA 5 January 2015 by the VISTA Expertise Network.
;;Based on Medsphere Systems Corporation's MSC FileMan 1051.
;;Licensed under the terms of the Apache License, Version 2.0.
;GFT;**999,1001,1009,1040,1045,1053,1054**
;
DD F I=1:1 S X=$T(DD+I),Y=$P(X," ",3,99) G ^DINIT22:X?.P S @("^DD(1.1,"_$E($P(X," ",2),3,99)_")=Y")
;;0 FIELD^^4.2^16
;;0,"ID","WRITE" N % S %=$P(^(0),U,2) D EN^DDIOL(" "_$$NAKED^DIUTL("$$DATE^DIUTL(%)"),"","?0")
;;0,"NM","AUDIT"
;;.001,0 NUMBER^NJ7,0^^ ^K:+X'=X!(X<1)!(X?.E1"."1N.N) X
;;.001,3 A whole number greater than 1.
;;.01,0 INTERNAL ENTRY NUMBER^RF^^0;1^K:X[""""!($A(X)=45) X I $D(X) K:$L(X)>16!($L(X)<1)!'(X'?1P.E) X
;;.01,.1 The Internal Number of the Entry that has been audited.
;;.01,1,0 ^.1
;;.01,1,1,0 1.1^B
;;.01,1,1,1 S ^DIA(DIA,"B",$E(X,1,30),DA)=""
;;.01,1,1,2 K ^DIA(DIA,"B",$E(X,1,30),DA)
;;.02,0 DATE/TIME RECORDED^RD^^0;2^S %DT="ETXR" D ^%DT S X=Y K:Y<1 X
;;.02,1,0 ^.1
;;.02,1,1,0 1.1^C
;;.02,1,1,1 S ^DIA(DIA,"C",$E(X,1,30),DA)=""
;;.02,1,1,2 K ^DIA(DIA,"C",$E(X,1,30),DA)
;;.03,0 FIELD NUMBER^RF^^0;3^K:$L(X)>10!$L(X)<1) X
;;.03,3 The number of the field that was audited.
;;.04,0 USER^RP200'^VA(200,^0;4^Q
;;.04,1,0 ^.1
;;.04,1,1,0 1.1^D
;;.04,1,1,1 S ^DIA(DIA,"D",$E(X,1,30),DA)=""
;;.04,1,1,2 K ^DIA(DIA,"D",$E(X,1,30),DA)
;;.05,0 RECORD ADDED^S^A:Added Record;^0;5^Q
;;.05,21,0 ^^2^2^2981028^
;;.05,21,1,0 When a new recorded is added to a file (sub-file) and the .01 field is
;;.05,21,2,0 being audited, then this field will be set to an 'A'.
;;.06,0 ACCESSED^S^i:INQUIRED TO ENTRY^0;6
;;.06,3 This field should only have a value if the audit event represents an inquiry that DID NOT CHANGE DATA
;;.06,21,0 ^^2^2
;;.06,21,1,0 This flag (settable by ACCESSED^DIET) is designed to record that a user LOOKED UP the Entry, without necessarily
;;.06,21,2,0 changing it. Such an audit might be set by the POST-SELECTION ACTION of a File, e.g. for HIPAA.
;;1,0 ENTRY NAME^CJ30^^ ; ^N C,Y S Y=^DIC(DIA,0,"GL"),X=^DIA(DIA,D0,0),Y=$P($G(@(Y_+X_",0)")),U),C=$P($G(^DD(DIA,.01,0)),U,2) D Y^DIQ:C]"" S X=Y
;;1,9 ^
;;1.1,0 FIELD NAME^CJ50X^^ ; ^S Y(1.1,1.1)=$S($D(^DIA(DIA,D0,0)):$P(^(0),U,3),1:""),X="" Q:$P($G(^(0)),U,6)="i" X ^DD(1.1,1.1,9.2) K Y(1.1) S X=$E(X,1,$L(X)-1)
;;1.1,9 ^
;;1.1,9.2 X ^DD(1.1,1.1,9.3) S X="" F %=1:1:%-1 S X=X_Y(1.1,%)_","
;;1.1,9.3 S X1=DIA F %=1:1 S X=$P(Y(1.1,1.1),",",%) Q:X="" S Y(1.1,%)=$S($D(^DD(X1,X,0)):$P(^(0),U,1,2),1:"????"),X1=+$P(Y(1.1,%),U,2),Y(1.1,%)=$P(Y(1.1,%),U,1)
;;2,0 OLD VALUE^CJ80^^ ; ^S X=$G(^DIA(DIA,D0,2)),X=$S(X]"":X,($P($G(^(0)),U,6)="i"!$D(^(2.14))):"",1:"<no previous value>")
;;2,9 ^
;;2.1,0 OLD INTERNAL VALUE^F^^2.1;1^K:$L(X)>30 X
;;2.2,0 DATATYPE OF OLD VALUE^S^S:SET;P:POINTER;V:VARIABLE POINTER;^2.1;2^Q
;;2.14,0 OLD W-P TEXT^Cm^^ ; ^X "N I,X F I=0:0 S I=$O(^DIA(DIA,D0,2.14,I)) Q:'I S X=$G(^(I,0)) X DICMX"
;;2.14,21,0 ^^1^1
;;2.14,21,1,0 Tells what the entire multi-line text field looked like BEFORE it was changed by the audited event.
;;2.9,0 PATIENT^Cp2^^ ; ^N A,% S %=$G(^DIC(DIA,0,"GL")),A=+$G(^DIA(DIA,D0,0)) X ^DD(1.1,2.9,9.2)
;;2.9,9 ^
;;2.9,9.1 N A,% S %=$G(^DIC(DIA,0,"GL")),A=+$G(^DIA(DIA,D0,0)) X ^DD(1.1,2.9,9.2)
;;2.9,9.2 S X="",X=$S(DIA=2:A,DIA=9000001:A,1:"") X ^DD(1.1,2.9,9.3):'X
;;2.9,9.3 N I,GL S I=$S($O(^DD(2,0,"PT",DIA,0)):+$O(^(0)),1:$O(^DD(9000001,0,"PT",DIA,0))) I I S GL=$P($G(^DD(DIA,I,0)),U,4) I GL'="" X ^DD(1.1,2.9,9.5)
;;2.9,9.4 S X=$S(X[";DPT(":+X,X[";AUPNPAT(":+X,1:"")
;;2.9,9.5 S X=$P(GL,";"),X=$S($D(@(%_+A_","""_X_""")")):$P(^(X),U,+$P(GL,";",2)),1:"") X:X[";" ^DD(1.1,2.9,9.4)
;;2.9,21,0 ^^2^2
;;2.9,21,1,0 If the audited File is #2 or #9000001, or if there is a pointer back to either of these Files from the audited File,
;;2.9,21,2,0 then this field shows which particular Patient is involved in the audited data.
;;3,0 NEW VALUE^CJ80^^ ; ^S X=$G(^DIA(DIA,D0,3)),X=$S(X]"":X,$G(^(2))]"":"<deleted>",1:"")
;;3,9 ^
;;3.1,0 NEW INTERNAL VALUE^F^^3.1;1^K:$L(X)>30 X
;;3.2,0 DATATYPE OF NEW VALUE^S^S:SET;P:POINTER;V:VARIABLE POINTER;^3.1;2^Q
;;4.1,0 MENU OPTION USED^P19'^DIC(19,^4.1;1^Q
;;4.1,21,0 ^^2^2^2981021^^
;;4.1,21,1,0 This is the Option that the Kernel menu system used to change the audited
;;4.1,21,2,0 data.
;;4.1,23,0 ^^2^2^2981021^
;;4.1,23,1,0 This field contains the value of +XQY and is a direct pointer to the
;;4.1,23,2,0 OPTION FILE (#19).
;;4.2,0 PROTOCOL or OPTION USED^V^^4.1;2^Q
;;4.2,3 Answer must be 1-63 characters in length.
;;4.2,21,0 ^^2^2^2981021^
;;4.2,21,1,0 This is the Protocol or Option (type Protocol) that was used when the
;;4.2,21,2,0 audit took place.
;;4.2,23,0 ^^3^3^2981021^^
;;4.2,23,1,0 This is a Variable Pointer field whose value is obtained from the local
;;4.2,23,2,0 variable XQORNOD, which is in the form ien;global root. It can either
;;4.2,23,3,0 point to the Option file or to the Protocol file.
;;4.2,"V",0 ^.12P^2^2
;;4.2,"V",1,0 19^What Option was used?^1^O^^n
;;4.2,"V",2,0 101^What Protocol was used?^2^P^^n
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HDINIT20 5275 printed Dec 13, 2024@02:50:47 Page 2
DINIT20 ;SFISC/XAK - INITIALIZE VA FILEMAN ;9JAN2016
+1 ;;22.2;VA FileMan;**2,14**;Jan 05, 2016;Build 8
+2 ;;Per VA Directive 6402, this routine should not be modified.
+3 ;;Submitted to OSEHRA 5 January 2015 by the VISTA Expertise Network.
+4 ;;Based on Medsphere Systems Corporation's MSC FileMan 1051.
+5 ;;Licensed under the terms of the Apache License, Version 2.0.
+6 ;GFT;**999,1001,1009,1040,1045,1053,1054**
+7 ;
DD FOR I=1:1
SET X=$TEXT(DD+I)
SET Y=$PIECE(X," ",3,99)
if X?.P
GOTO ^DINIT22
SET @("^DD(1.1,"_$EXTRACT($PIECE(X," ",2),3,99)_")=Y")
+1 ;;0 FIELD^^4.2^16
+2 ;;0,"ID","WRITE" N % S %=$P(^(0),U,2) D EN^DDIOL(" "_$$NAKED^DIUTL("$$DATE^DIUTL(%)"),"","?0")
+3 ;;0,"NM","AUDIT"
+4 ;;.001,0 NUMBER^NJ7,0^^ ^K:+X'=X!(X<1)!(X?.E1"."1N.N) X
+5 ;;.001,3 A whole number greater than 1.
+6 ;;.01,0 INTERNAL ENTRY NUMBER^RF^^0;1^K:X[""""!($A(X)=45) X I $D(X) K:$L(X)>16!($L(X)<1)!'(X'?1P.E) X
+7 ;;.01,.1 The Internal Number of the Entry that has been audited.
+8 ;;.01,1,0 ^.1
+9 ;;.01,1,1,0 1.1^B
+10 ;;.01,1,1,1 S ^DIA(DIA,"B",$E(X,1,30),DA)=""
+11 ;;.01,1,1,2 K ^DIA(DIA,"B",$E(X,1,30),DA)
+12 ;;.02,0 DATE/TIME RECORDED^RD^^0;2^S %DT="ETXR" D ^%DT S X=Y K:Y<1 X
+13 ;;.02,1,0 ^.1
+14 ;;.02,1,1,0 1.1^C
+15 ;;.02,1,1,1 S ^DIA(DIA,"C",$E(X,1,30),DA)=""
+16 ;;.02,1,1,2 K ^DIA(DIA,"C",$E(X,1,30),DA)
+17 ;;.03,0 FIELD NUMBER^RF^^0;3^K:$L(X)>10!$L(X)<1) X
+18 ;;.03,3 The number of the field that was audited.
+19 ;;.04,0 USER^RP200'^VA(200,^0;4^Q
+20 ;;.04,1,0 ^.1
+21 ;;.04,1,1,0 1.1^D
+22 ;;.04,1,1,1 S ^DIA(DIA,"D",$E(X,1,30),DA)=""
+23 ;;.04,1,1,2 K ^DIA(DIA,"D",$E(X,1,30),DA)
+24 ;;.05,0 RECORD ADDED^S^A:Added Record;^0;5^Q
+25 ;;.05,21,0 ^^2^2^2981028^
+26 ;;.05,21,1,0 When a new recorded is added to a file (sub-file) and the .01 field is
+27 ;;.05,21,2,0 being audited, then this field will be set to an 'A'.
+28 ;;.06,0 ACCESSED^S^i:INQUIRED TO ENTRY^0;6
+29 ;;.06,3 This field should only have a value if the audit event represents an inquiry that DID NOT CHANGE DATA
+30 ;;.06,21,0 ^^2^2
+31 ;;.06,21,1,0 This flag (settable by ACCESSED^DIET) is designed to record that a user LOOKED UP the Entry, without necessarily
+32 ;;.06,21,2,0 changing it. Such an audit might be set by the POST-SELECTION ACTION of a File, e.g. for HIPAA.
+33 ;;1,0 ENTRY NAME^CJ30^^ ; ^N C,Y S Y=^DIC(DIA,0,"GL"),X=^DIA(DIA,D0,0),Y=$P($G(@(Y_+X_",0)")),U),C=$P($G(^DD(DIA,.01,0)),U,2) D Y^DIQ:C]"" S X=Y
+34 ;;1,9 ^
+35 ;;1.1,0 FIELD NAME^CJ50X^^ ; ^S Y(1.1,1.1)=$S($D(^DIA(DIA,D0,0)):$P(^(0),U,3),1:""),X="" Q:$P($G(^(0)),U,6)="i" X ^DD(1.1,1.1,9.2) K Y(1.1) S X=$E(X,1,$L(X)-1)
+36 ;;1.1,9 ^
+37 ;;1.1,9.2 X ^DD(1.1,1.1,9.3) S X="" F %=1:1:%-1 S X=X_Y(1.1,%)_","
+38 ;;1.1,9.3 S X1=DIA F %=1:1 S X=$P(Y(1.1,1.1),",",%) Q:X="" S Y(1.1,%)=$S($D(^DD(X1,X,0)):$P(^(0),U,1,2),1:"????"),X1=+$P(Y(1.1,%),U,2),Y(1.1,%)=$P(Y(1.1,%),U,1)
+39 ;;2,0 OLD VALUE^CJ80^^ ; ^S X=$G(^DIA(DIA,D0,2)),X=$S(X]"":X,($P($G(^(0)),U,6)="i"!$D(^(2.14))):"",1:"<no previous value>")
+40 ;;2,9 ^
+41 ;;2.1,0 OLD INTERNAL VALUE^F^^2.1;1^K:$L(X)>30 X
+42 ;;2.2,0 DATATYPE OF OLD VALUE^S^S:SET;P:POINTER;V:VARIABLE POINTER;^2.1;2^Q
+43 ;;2.14,0 OLD W-P TEXT^Cm^^ ; ^X "N I,X F I=0:0 S I=$O(^DIA(DIA,D0,2.14,I)) Q:'I S X=$G(^(I,0)) X DICMX"
+44 ;;2.14,21,0 ^^1^1
+45 ;;2.14,21,1,0 Tells what the entire multi-line text field looked like BEFORE it was changed by the audited event.
+46 ;;2.9,0 PATIENT^Cp2^^ ; ^N A,% S %=$G(^DIC(DIA,0,"GL")),A=+$G(^DIA(DIA,D0,0)) X ^DD(1.1,2.9,9.2)
+47 ;;2.9,9 ^
+48 ;;2.9,9.1 N A,% S %=$G(^DIC(DIA,0,"GL")),A=+$G(^DIA(DIA,D0,0)) X ^DD(1.1,2.9,9.2)
+49 ;;2.9,9.2 S X="",X=$S(DIA=2:A,DIA=9000001:A,1:"") X ^DD(1.1,2.9,9.3):'X
+50 ;;2.9,9.3 N I,GL S I=$S($O(^DD(2,0,"PT",DIA,0)):+$O(^(0)),1:$O(^DD(9000001,0,"PT",DIA,0))) I I S GL=$P($G(^DD(DIA,I,0)),U,4) I GL'="" X ^DD(1.1,2.9,9.5)
+51 ;;2.9,9.4 S X=$S(X[";DPT(":+X,X[";AUPNPAT(":+X,1:"")
+52 ;;2.9,9.5 S X=$P(GL,";"),X=$S($D(@(%_+A_","""_X_""")")):$P(^(X),U,+$P(GL,";",2)),1:"") X:X[";" ^DD(1.1,2.9,9.4)
+53 ;;2.9,21,0 ^^2^2
+54 ;;2.9,21,1,0 If the audited File is #2 or #9000001, or if there is a pointer back to either of these Files from the audited File,
+55 ;;2.9,21,2,0 then this field shows which particular Patient is involved in the audited data.
+56 ;;3,0 NEW VALUE^CJ80^^ ; ^S X=$G(^DIA(DIA,D0,3)),X=$S(X]"":X,$G(^(2))]"":"<deleted>",1:"")
+57 ;;3,9 ^
+58 ;;3.1,0 NEW INTERNAL VALUE^F^^3.1;1^K:$L(X)>30 X
+59 ;;3.2,0 DATATYPE OF NEW VALUE^S^S:SET;P:POINTER;V:VARIABLE POINTER;^3.1;2^Q
+60 ;;4.1,0 MENU OPTION USED^P19'^DIC(19,^4.1;1^Q
+61 ;;4.1,21,0 ^^2^2^2981021^^
+62 ;;4.1,21,1,0 This is the Option that the Kernel menu system used to change the audited
+63 ;;4.1,21,2,0 data.
+64 ;;4.1,23,0 ^^2^2^2981021^
+65 ;;4.1,23,1,0 This field contains the value of +XQY and is a direct pointer to the
+66 ;;4.1,23,2,0 OPTION FILE (#19).
+67 ;;4.2,0 PROTOCOL or OPTION USED^V^^4.1;2^Q
+68 ;;4.2,3 Answer must be 1-63 characters in length.
+69 ;;4.2,21,0 ^^2^2^2981021^
+70 ;;4.2,21,1,0 This is the Protocol or Option (type Protocol) that was used when the
+71 ;;4.2,21,2,0 audit took place.
+72 ;;4.2,23,0 ^^3^3^2981021^^
+73 ;;4.2,23,1,0 This is a Variable Pointer field whose value is obtained from the local
+74 ;;4.2,23,2,0 variable XQORNOD, which is in the form ien;global root. It can either
+75 ;;4.2,23,3,0 point to the Option file or to the Protocol file.
+76 ;;4.2,"V",0 ^.12P^2^2
+77 ;;4.2,"V",1,0 19^What Option was used?^1^O^^n
+78 ;;4.2,"V",2,0 101^What Protocol was used?^2^P^^n