1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.openehealth.ipf.commons.ihe.hpd.iti59;
18
19 import org.apache.commons.lang3.StringUtils;
20 import org.openehealth.ipf.commons.audit.AuditContext;
21 import org.openehealth.ipf.commons.audit.codes.ParticipantObjectTypeCodeRole;
22 import org.openehealth.ipf.commons.audit.model.AuditMessage;
23 import org.openehealth.ipf.commons.audit.model.TypeValuePairType;
24 import org.openehealth.ipf.commons.ihe.core.atna.event.PHIExportBuilder;
25 import org.openehealth.ipf.commons.ihe.hpd.audit.codes.HpdEventTypeCode;
26 import org.openehealth.ipf.commons.ihe.hpd.audit.codes.HpdParticipantObjectIdTypeCode;
27
28 import java.util.Collections;
29 import java.util.List;
30
31
32
33
34 public class Iti59ClientAuditStrategy extends Iti59AuditStrategy {
35
36 public Iti59ClientAuditStrategy() {
37 super(false);
38 }
39
40 protected AuditMessage makeAuditMessage(AuditContext auditContext,
41 Iti59AuditDataset auditDataset,
42 Iti59AuditDataset.RequestItem requestItem) {
43 PHIExportBuilder builder = new PHIExportBuilder<>(
44 auditContext,
45 auditDataset,
46 requestItem.getOutcomeCode(),
47 null,
48 requestItem.getActionCode(),
49 HpdEventTypeCode.ProviderInformationFeed,
50 auditDataset.getPurposesOfUse()
51 );
52
53 List<TypeValuePairType> details = StringUtils.isBlank(requestItem.getNewUid())
54 ? Collections.emptyList()
55 : Collections.singletonList(new TypeValuePairType("new uid", requestItem.getNewUid()));
56
57 builder.addExportedEntity(
58 requestItem.getUid(),
59 HpdParticipantObjectIdTypeCode.RelativeDistinguishedName,
60 requestItem.getParticipantObjectTypeCode(),
61 ParticipantObjectTypeCodeRole.Provider,
62 details
63 );
64
65 return builder.getMessage();
66 }
67
68 }