1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.openehealth.ipf.commons.ihe.fhir.audit.codes;
18
19 import ca.uhn.fhir.rest.api.RestOperationTypeEnum;
20 import lombok.Getter;
21 import org.openehealth.ipf.commons.audit.types.EnumeratedCodedValue;
22 import org.openehealth.ipf.commons.audit.types.EnumeratedValueSet;
23 import org.openehealth.ipf.commons.audit.types.EventType;
24
25
26
27
28 public enum FhirEventTypeCode implements EventType, EnumeratedCodedValue<EventType> {
29
30 ProvideDocumentBundle("ITI-65", "Provide Document Bundle"),
31 MobileDocumentManifestQuery("ITI-66", "Mobile Document Manifest Query"),
32 MobileDocumentReferenceQuery("ITI-67", "Mobile Document Reference Query"),
33 MobileDocumentRetrieval("ITI-68", "Mobile Document Retrieval"),
34 MobilePatientDemographicsQuery("ITI-78", "Mobile Patient Demographics Query"),
35 MobilePatientIdentifierCrossReferenceQuery("ITI-83", "Mobile Patient Identifier Cross-reference Query"),
36 MobileQueryExistingData("PCC-44", "Mobile Query Existing Data");
37
38 @Getter
39 private EventType value;
40
41 FhirEventTypeCode(String code, String displayName) {
42 this.value = EventType.of(code, "IHE Transactions", displayName);
43 }
44
45 public static EventType fromRestOperationType(RestOperationTypeEnum operation) {
46 return fromRestOperationType(operation, null);
47 }
48
49 public static EventType fromRestOperationType(RestOperationTypeEnum operation, String originalText) {
50 return EventType.of(
51 operation.getCode(),
52 "http://hl7.org/fhir/restful-interaction",
53 originalText != null ? originalText : operation.getCode());
54 }
55
56 }