1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.openehealth.ipf.commons.ihe.core.atna.custom;
17
18 import org.openhealthtools.ihe.atna.auditor.IHEAuditor;
19 import org.openhealthtools.ihe.atna.auditor.codes.rfc3881.RFC3881EventCodes;
20 import org.openhealthtools.ihe.atna.auditor.context.AuditorModuleContext;
21 import org.openhealthtools.ihe.atna.auditor.models.rfc3881.CodedValueType;
22 import org.openhealthtools.ihe.atna.auditor.utils.EventUtils;
23
24 import java.util.Collection;
25 import java.util.List;
26
27 import static org.openehealth.ipf.commons.ihe.core.atna.custom.CustomAuditorUtils.configureEvent;
28
29
30
31
32
33
34
35
36
37
38 public class HpdAuditor extends IHEAuditor {
39
40 public static HpdAuditor getAuditor() {
41 AuditorModuleContext ctx = AuditorModuleContext.getContext();
42 return (HpdAuditor) ctx.getAuditor(HpdAuditor.class);
43 }
44
45 public void auditIti59(
46 boolean serverSide,
47 RFC3881EventCodes.RFC3881EventActionCodes eventActionCode,
48 RFC3881EventCodes.RFC3881EventOutcomeCodes eventOutcome,
49 String replyToUri,
50 String userName,
51 String directoryUri,
52 String clientIpAddress,
53 Collection<String> providerIds,
54 String dn,
55 String newRdn,
56 List<CodedValueType> purposesOfUse,
57 List<CodedValueType> userRoles)
58 {
59 if (! isAuditorEnabled()) {
60 return;
61 }
62
63 HpdEvent event = new HpdEvent(
64 !serverSide,
65 eventActionCode,
66 eventOutcome,
67 purposesOfUse);
68
69 configureEvent(this, serverSide, event, replyToUri, userName, directoryUri,
70 directoryUri, clientIpAddress, userRoles);
71 if (!EventUtils.isEmptyOrNull(providerIds)) {
72 providerIds.forEach(event::addProviderParticipantObject);
73 }
74 if (!EventUtils.isEmptyOrNull(dn)) {
75 event.addEntryParticipantObject(dn);
76 }
77 if (!EventUtils.isEmptyOrNull(newRdn)) {
78 event.addEntryParticipantObject(newRdn);
79 }
80 audit(event);
81 }
82
83 }