/
Concept.java
396 lines (298 loc) · 8.25 KB
/
Concept.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
package org.openconceptlab.fhir.model;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import org.hibernate.annotations.Type;
import org.openconceptlab.fhir.util.OclFhirUtil;
import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
/**
* The persistent class for the concepts database table.
* @author harpatel1
*/
@Entity
@Table(name="concepts")
public class Concept extends BaseOclEntity implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column
private String comment;
@Column(name="concept_class")
private String conceptClass = "N/A";
@Column(name="created_at")
private Timestamp createdAt = new Timestamp(System.currentTimeMillis());
@Column
private String datatype = "N/A";
@Column(name="default_locale")
private String defaultLocale;
@Column
private String description;
@Column(name="external_id")
private String externalId;
@Type(type = "jsonb")
@Column(columnDefinition = "jsonb")
private String extras;
@Column(name="full_name")
private String fullName;
@Column(name="internal_reference_id")
private String internalReferenceId;
@Column(name="is_active")
private Boolean isActive;
@Column(name="is_latest_version")
private Boolean isLatestVersion;
@Column
private String mnemonic;
@Column
private String name;
@Column(name="public_access")
private String publicAccess;
@Column
private Boolean released;
@Column
private Boolean retired;
@Type(type = "jsonb")
@Column(name="supported_locales", columnDefinition = "jsonb")
private String supportedLocales;
@Column(name="updated_at")
private Timestamp updatedAt = new Timestamp(System.currentTimeMillis());;
@Column
private String uri;
@Column
private String version;
@Column
private String website;
@ManyToOne
@JoinColumn(name="versioned_object_id")
private Concept versionedObject;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name="parent_id")
private Source parent;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name="created_by_id")
private UserProfile createdBy;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name="updated_by_id")
private UserProfile updatedBy;
// @LazyCollection(LazyCollectionOption.FALSE)
@OneToMany(mappedBy="concept", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private List<ConceptsDescription> conceptsDescriptions;
// @LazyCollection(LazyCollectionOption.FALSE)
@OneToMany(mappedBy="concept", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private List<ConceptsName> conceptsNames;
@OneToMany(mappedBy="concept", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
private List<ConceptsSource> conceptsSources;
public List<ConceptsSource> getConceptsSources() {
return conceptsSources;
}
public void setConceptsSources(List<ConceptsSource> conceptsSources) {
this.conceptsSources = conceptsSources;
}
public Concept() {
}
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public String getComment() {
return this.comment;
}
public void setComment(String comment) {
this.comment = comment;
}
public String getConceptClass() {
return this.conceptClass;
}
public void setConceptClass(String conceptClass) {
this.conceptClass = conceptClass;
}
public Timestamp getCreatedAt() {
return this.createdAt;
}
public void setCreatedAt(Timestamp createdAt) {
this.createdAt = createdAt;
}
public String getDatatype() {
return this.datatype;
}
public void setDatatype(String datatype) {
this.datatype = datatype;
}
public String getDefaultLocale() {
return this.defaultLocale;
}
public void setDefaultLocale(String defaultLocale) {
this.defaultLocale = defaultLocale;
}
public String getDescription() {
return this.description;
}
public void setDescription(String description) {
this.description = description;
}
public String getExternalId() {
return this.externalId;
}
public void setExternalId(String externalId) {
this.externalId = externalId;
}
public String getExtras() {
return this.extras;
}
public void setExtras(String extras) {
this.extras = extras;
}
public String getFullName() {
return this.fullName;
}
public void setFullName(String fullName) {
this.fullName = fullName;
}
public String getInternalReferenceId() {
return this.internalReferenceId;
}
public void setInternalReferenceId(String internalReferenceId) {
this.internalReferenceId = internalReferenceId;
}
public Boolean getIsActive() {
return this.isActive;
}
public void setIsActive(Boolean isActive) {
this.isActive = isActive;
}
public Boolean getIsLatestVersion() {
return this.isLatestVersion;
}
public void setIsLatestVersion(Boolean isLatestVersion) {
this.isLatestVersion = isLatestVersion;
}
public String getMnemonic() {
return OclFhirUtil.decodeValue(this.mnemonic);
}
public void setMnemonic(String mnemonic) {
this.mnemonic = mnemonic;
}
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String getPublicAccess() {
return this.publicAccess;
}
public void setPublicAccess(String publicAccess) {
this.publicAccess = publicAccess;
}
public Boolean getReleased() {
return this.released != null ? this.released : false;
}
public void setReleased(Boolean released) {
this.released = released;
}
public Boolean getRetired() {
if (this.retired == null) {
this.retired = false;
}
return this.retired;
}
public void setRetired(Boolean retired) {
this.retired = retired;
}
public String getSupportedLocales() {
return this.supportedLocales;
}
public void setSupportedLocales(String supportedLocales) {
this.supportedLocales = supportedLocales;
}
public Timestamp getUpdatedAt() {
return this.updatedAt;
}
public void setUpdatedAt(Timestamp updatedAt) {
this.updatedAt = updatedAt;
}
public String getUri() {
return this.uri;
}
public void setUri(String uri) {
this.uri = uri;
}
public String getVersion() {
return this.version;
}
public void setVersion(String version) {
this.version = version;
}
public String getWebsite() {
return this.website;
}
public void setWebsite(String website) {
this.website = website;
}
public Concept getVersionedObject() {
return this.versionedObject;
}
public void setVersionedObject(Concept concept) {
this.versionedObject = concept;
}
public Source getParent() {
return this.parent;
}
public void setParent(Source source) {
this.parent = source;
}
public UserProfile getCreatedBy() {
return this.createdBy;
}
public void setCreatedBy(UserProfile createdBy) {
this.createdBy = createdBy;
}
public UserProfile getUpdatedBy() {
return this.updatedBy;
}
public void setUpdatedBy(UserProfile updatedBy) {
this.updatedBy = updatedBy;
}
public List<ConceptsDescription> getConceptsDescriptions() {
if (this.conceptsDescriptions == null)
this.conceptsDescriptions = new ArrayList<>();
return this.conceptsDescriptions;
}
public void setConceptsDescriptions(List<ConceptsDescription> conceptsDescriptions) {
this.conceptsDescriptions = conceptsDescriptions;
}
public ConceptsDescription addConceptsDescription(ConceptsDescription conceptsDescription) {
getConceptsDescriptions().add(conceptsDescription);
conceptsDescription.setConcept(this);
return conceptsDescription;
}
public ConceptsDescription removeConceptsDescription(ConceptsDescription conceptsDescription) {
getConceptsDescriptions().remove(conceptsDescription);
conceptsDescription.setConcept(null);
return conceptsDescription;
}
public List<ConceptsName> getConceptsNames() {
if (this.conceptsNames == null)
this.conceptsNames = new ArrayList<>();
return this.conceptsNames;
}
public void setConceptsNames(List<ConceptsName> conceptsNames) {
this.conceptsNames = conceptsNames;
}
public ConceptsName addConceptsName(ConceptsName conceptsName) {
getConceptsNames().add(conceptsName);
conceptsName.setConcept(this);
return conceptsName;
}
public ConceptsName removeConceptsName(ConceptsName conceptsName) {
getConceptsNames().remove(conceptsName);
conceptsName.setConcept(null);
return conceptsName;
}
}