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.codes.dicom.DICOMEventIdCodes;
19 import org.openhealthtools.ihe.atna.auditor.codes.ihe.IHETransactionEventTypeCodes;
20 import org.openhealthtools.ihe.atna.auditor.codes.rfc3881.RFC3881EventCodes;
21 import org.openhealthtools.ihe.atna.auditor.codes.rfc3881.RFC3881ParticipantObjectCodes;
22 import org.openhealthtools.ihe.atna.auditor.events.ihe.GenericIHEAuditEventMessage;
23 import org.openhealthtools.ihe.atna.auditor.models.rfc3881.CodedValueType;
24 import org.openhealthtools.ihe.atna.auditor.models.rfc3881.TypeValuePairType;
25 import org.openhealthtools.ihe.atna.auditor.utils.EventUtils;
26
27 import java.nio.charset.Charset;
28 import java.util.LinkedList;
29 import java.util.List;
30
31
32
33
34
35
36
37 public class ImagingRetrieveEvent extends GenericIHEAuditEventMessage {
38
39 public ImagingRetrieveEvent(
40 boolean systemIsSource,
41 RFC3881EventCodes.RFC3881EventOutcomeCodes outcome,
42 IHETransactionEventTypeCodes eventType,
43 List<CodedValueType> purposesOfUse)
44 {
45 super(systemIsSource,
46 outcome,
47 systemIsSource ? RFC3881EventCodes.RFC3881EventActionCodes.CREATE : RFC3881EventCodes.RFC3881EventActionCodes.READ,
48 systemIsSource ? new DICOMEventIdCodes.Import() : new DICOMEventIdCodes.Export(),
49 eventType,
50 purposesOfUse);
51 }
52
53
54 protected void addTypeValuePair(List<TypeValuePairType> pairs, String type, String value) {
55 if (! EventUtils.isEmptyOrNull(value)) {
56 pairs.add(getTypeValuePair(type, value.getBytes(Charset.defaultCharset())));
57 }
58 }
59
60
61 public void addDocumentParticipantObject(
62 String studyInstanceUniqueId,
63 String seriesInstanceUniqueId,
64 String documentUniqueId,
65 String repositoryUniqueId,
66 String homeCommunityId)
67 {
68 List<TypeValuePairType> pairs = new LinkedList<>();
69 addTypeValuePair(pairs, "Study Instance Unique Id", studyInstanceUniqueId);
70 addTypeValuePair(pairs, "Series Instance Unique Id", seriesInstanceUniqueId);
71 addTypeValuePair(pairs, "Repository Unique Id", repositoryUniqueId);
72 addTypeValuePair(pairs, "ihe:homeCommunityID", homeCommunityId);
73
74 addParticipantObjectIdentification(
75 new RFC3881ParticipantObjectCodes.RFC3881ParticipantObjectIDTypeCodes.ReportNumber(),
76 null,
77 null,
78 pairs,
79 documentUniqueId,
80 RFC3881ParticipantObjectCodes.RFC3881ParticipantObjectTypeCodes.SYSTEM,
81 RFC3881ParticipantObjectCodes.RFC3881ParticipantObjectTypeRoleCodes.REPORT,
82 null,
83 null);
84 }
85
86 }