-
Notifications
You must be signed in to change notification settings - Fork 3.6k
/
ConceptComplex.java
107 lines (93 loc) · 2.59 KB
/
ConceptComplex.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
/**
* This Source Code Form is subject to the terms of the Mozilla Public License,
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
* obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
* the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
*
* Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
* graphic logo is a trademark of OpenMRS Inc.
*/
package org.openmrs;
import org.hibernate.search.annotations.Indexed;
import org.openmrs.obs.ComplexObsHandler;
/**
* Child class of Concept that has a {@link ComplexObsHandler} associated with the Concept.
*
* @since 1.5
*/
@Indexed
public class ConceptComplex extends Concept {
public static final long serialVersionUID = 473231233L;
private String handler;
/**
* Default Constructor
*/
public ConceptComplex() {
}
/**
* @param conceptId
*/
public ConceptComplex(Integer conceptId) {
super(conceptId);
}
/**
* Constructor with conceptId and ConceptComplexHandler
*
* @param conceptId
* @param handler
*/
public ConceptComplex(Integer conceptId, String handler) {
super(conceptId);
this.handler = handler;
}
/**
* Constructor from Concept.
*
* @param c
*/
public ConceptComplex(Concept c) {
this.setAnswers(c.getAnswers(true));
this.setChangedBy(c.getChangedBy());
this.setConceptClass(c.getConceptClass());
this.setConceptId(c.getConceptId());
this.setConceptSets(c.getConceptSets());
this.setCreator(c.getCreator());
this.setDatatype(c.getDatatype());
this.setDateChanged(c.getDateChanged());
this.setDateCreated(c.getDateCreated());
this.setSet(c.getSet());
this.setNames(c.getNames());
this.setDescriptions(c.getDescriptions());
this.setConceptMappings(c.getConceptMappings());
this.setRetired(c.getRetired());
this.setVersion(c.getVersion());
this.setUuid(c.getUuid());
this.handler = "";
}
/**
* Overrides parent method and returns true if this Concept.getDatatype() equals "Complex"..
*
* @see org.openmrs.Concept#isComplex()
*/
@Override
public boolean isComplex() {
if (getDatatype() == null || getDatatype().getHl7Abbreviation() == null) {
return false;
}
return "ED".equals(getDatatype().getHl7Abbreviation());
}
/**
* Set the ConceptComplexHandler. This should be the ComplexObsHandler key
*
* @param handler
*/
public void setHandler(String handler) {
this.handler = handler;
}
/**
* @return Returns the key to the ComplexObsHandler associated with this ConceptComplex.
*/
public String getHandler() {
return this.handler;
}
}