1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.openehealth.ipf.boot.fhir;
18
19 import ca.uhn.fhir.context.FhirVersionEnum;
20 import lombok.Getter;
21 import lombok.Setter;
22 import org.springframework.boot.context.properties.ConfigurationProperties;
23 import org.springframework.boot.context.properties.NestedConfigurationProperty;
24 import org.springframework.core.io.Resource;
25 import org.springframework.validation.annotation.Validated;
26
27 import javax.validation.constraints.NotNull;
28 import javax.validation.constraints.Pattern;
29 import java.util.ArrayList;
30 import java.util.HashMap;
31 import java.util.List;
32 import java.util.Map;
33
34
35
36
37 @Validated
38 @ConfigurationProperties(prefix = "ipf.fhir")
39 public class IpfFhirConfigurationProperties {
40
41
42
43
44 @Getter @Setter
45 private FhirVersionEnum fhirVersion = FhirVersionEnum.DSTU3;
46
47 @NestedConfigurationProperty
48 @Getter
49 private final Servlet servlet = new Servlet();
50
51
52
53
54 @NotNull
55 @Getter @Setter
56 @Pattern(regexp = "/[^?#]*", message = "Path must start with /")
57 private String path = "/fhir";
58
59
60
61
62 @Getter @Setter
63 private List<Resource> namingSystems = new ArrayList<>();
64
65
66
67
68 @Getter @Setter
69 private boolean caching;
70
71
72
73 String getFhirMapping() {
74 String path = getPath();
75 return path.endsWith("/") ? path + "*" : path + "/*";
76 }
77
78 public static class Servlet {
79
80
81
82
83 @Getter @Setter
84 private Map<String, String> init = new HashMap<>();
85
86
87
88
89 @Getter @Setter
90 private int loadOnStartup = 1;
91
92
93
94
95 @Getter @Setter
96 private String name = "FhirServlet";
97
98
99
100
101 @Getter @Setter
102 private int pagingRequests = 50;
103
104
105
106
107 @Getter @Setter
108 private int defaultPageSize = 50;
109
110
111
112
113 @Getter @Setter
114 private int maxPageSize = 100;
115
116
117
118
119
120 @Getter @Setter
121 private boolean distributedPagingProvider = false;
122
123
124
125
126 @Getter @Setter
127 private boolean logging = false;
128
129
130
131
132 @Getter @Setter
133 private boolean prettyPrint = true;
134
135
136
137
138 @Getter @Setter
139 private boolean responseHighlighting = true;
140
141
142
143
144 @Getter @Setter
145 private boolean strict = false;
146 }
147 }