-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathConsentField.java
More file actions
63 lines (52 loc) · 1.54 KB
/
Copy pathConsentField.java
File metadata and controls
63 lines (52 loc) · 1.54 KB
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
package org.openhmis.code;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import org.openhmis.code.serialization.CodeSerializer;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import org.openhmis.code.serialization.CodeLookup;
@JsonSerialize(using = CodeSerializer.class)
@XmlEnum
public enum ConsentField implements BaseCode {
@XmlEnumValue("-1")
ERR_UNKNOWN (-1, "Unknown"),
@XmlEnumValue("dob")
DATE_OF_BIRTH (0, "dob"),
@XmlEnumValue("1")
ETHNICITY (1, "ethnicity"),
@XmlEnumValue("2")
FIRST_NAME (2, "firstName"),
@XmlEnumValue("3")
GENDER (3, "gender"),
@XmlEnumValue("4")
LAST_NAME (4, "lastNanme"),
@XmlEnumValue("5")
MIDDLE_NAME (5, "middleNanme"),
@XmlEnumValue("6")
NAME_SUFFIX (6, "nameSuffix"),
@XmlEnumValue("7")
RACE (7, "race"),
@XmlEnumValue("8")
SSN (8, "ssn"),
@XmlEnumValue("9")
VETERAN_STATUS (9, "veteranStatus");
private final Integer code;
private final String description;
ConsentField(final Integer code, final String description) {
this.code = code;
this.description = description;
}
public Integer getCode() {
return code;
}
public String getDescription() {
return description;
}
// Enable lookups by code
private static final CodeLookup<ConsentField> enhancer = new CodeLookup<ConsentField>(values());
@JsonCreator
public static ConsentField valueByCode(Integer code) {
ConsentField value = enhancer.valueByCode(code);
return (value == null)?ConsentField.ERR_UNKNOWN:value;
}
}