1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.openehealth.ipf.commons.ihe.fhir.iti81;
18
19 import ca.uhn.fhir.model.api.Include;
20 import ca.uhn.fhir.rest.annotation.*;
21 import ca.uhn.fhir.rest.api.SortSpec;
22 import ca.uhn.fhir.rest.api.server.IBundleProvider;
23 import ca.uhn.fhir.rest.param.DateRangeParam;
24 import ca.uhn.fhir.rest.param.StringAndListParam;
25 import ca.uhn.fhir.rest.param.TokenAndListParam;
26 import org.hl7.fhir.dstu3.model.AuditEvent;
27 import org.openehealth.ipf.commons.ihe.fhir.AbstractPlainProvider;
28
29 import javax.servlet.http.HttpServletRequest;
30 import javax.servlet.http.HttpServletResponse;
31 import java.util.Set;
32
33
34
35
36
37
38
39
40 public class Iti81ResourceProvider extends AbstractPlainProvider {
41
42 @SuppressWarnings("unused")
43 @Search(type = AuditEvent.class)
44 public IBundleProvider auditSearch(
45 @RequiredParam(name = AuditEvent.SP_DATE) DateRangeParam interval,
46 @OptionalParam(name = AuditEvent.SP_ADDRESS) StringAndListParam address,
47 @OptionalParam(name = AuditEvent.SP_PATIENT + ".identifier") TokenAndListParam patientId,
48 @OptionalParam(name = AuditEvent.SP_ENTITY_ID) TokenAndListParam entityId,
49 @OptionalParam(name = AuditEvent.SP_ENTITY_TYPE) TokenAndListParam entityType,
50 @OptionalParam(name = AuditEvent.SP_ENTITY_ROLE) TokenAndListParam entityRole,
51 @OptionalParam(name = AuditEvent.SP_SOURCE) StringAndListParam source,
52 @OptionalParam(name = AuditEvent.SP_TYPE) TokenAndListParam type,
53 @OptionalParam(name = AuditEvent.SP_USER) StringAndListParam user,
54 @OptionalParam(name = AuditEvent.SP_SUBTYPE) TokenAndListParam subtype,
55 @OptionalParam(name = Iti81Constants.SP_OUTCOME) TokenAndListParam outcome,
56 @Sort SortSpec sortSpec,
57 @IncludeParam Set<Include> includeSpec,
58 HttpServletRequest httpServletRequest,
59 HttpServletResponse httpServletResponse) {
60
61 Iti81SearchParameters searchParameters = Iti81SearchParameters.builder()
62 .interval(interval)
63 .address(address)
64 .patientId(patientId)
65 .entityId(entityId)
66 .entityType(entityType)
67 .entityRole(entityRole)
68 .source(source)
69 .type(type)
70 .user(user)
71 .subtype(subtype)
72 .outcome(outcome)
73 .sortSpec(sortSpec)
74 .includeSpec(includeSpec)
75 .fhirContext(getFhirContext())
76 .build();
77
78
79 return requestBundleProvider(null, searchParameters, httpServletRequest, httpServletResponse);
80
81 }
82
83 }