1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.openehealth.ipf.commons.ihe.fhir.iti66;
18
19 import ca.uhn.fhir.context.FhirContext;
20 import ca.uhn.fhir.model.api.Include;
21 import ca.uhn.fhir.rest.api.SortSpec;
22 import ca.uhn.fhir.rest.param.DateRangeParam;
23 import ca.uhn.fhir.rest.param.ReferenceParam;
24 import ca.uhn.fhir.rest.param.StringParam;
25 import ca.uhn.fhir.rest.param.TokenOrListParam;
26 import ca.uhn.fhir.rest.param.TokenParam;
27 import lombok.Builder;
28 import lombok.Getter;
29 import lombok.Setter;
30 import lombok.ToString;
31 import org.openehealth.ipf.commons.ihe.fhir.FhirSearchParameters;
32
33 import java.util.Collections;
34 import java.util.List;
35 import java.util.Set;
36
37
38
39
40 @Builder @ToString
41 public class Iti66SearchParameters implements FhirSearchParameters {
42
43 @Getter @Setter private DateRangeParam created;
44 @Getter @Setter private StringParam authorFamilyName;
45 @Getter @Setter private StringParam authorGivenName;
46 @Getter @Setter private TokenOrListParam type;
47 @Getter @Setter private TokenOrListParam source;
48 @Getter @Setter private TokenOrListParam status;
49 @Getter @Setter private ReferenceParam patientReference;
50 @Getter @Setter private TokenParam patientIdentifier;
51 @Getter @Setter private TokenParam _id;
52
53 @Getter @Setter private SortSpec sortSpec;
54 @Getter @Setter private Set<Include> includeSpec;
55
56 @Getter
57 private FhirContext fhirContext;
58
59 @Override
60 public List<TokenParam> getPatientIdParam() {
61 if (_id != null)
62 return Collections.singletonList(_id);
63 if (patientReference != null)
64 return Collections.singletonList(patientReference.toTokenParam(fhirContext));
65
66 return Collections.singletonList(patientIdentifier);
67 }
68 }