1
2 package ca.uhn.fhir.model.dstu.valueset;
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 import java.util.HashMap;
25 import java.util.Map;
26
27 import ca.uhn.fhir.model.api.IValueSetEnumBinder;
28
29 public enum ResourceProfileStatusEnum {
30
31
32
33
34
35
36 DRAFT("draft", "http://hl7.org/fhir/resource-profile-status"),
37
38
39
40
41
42
43 ACTIVE("active", "http://hl7.org/fhir/resource-profile-status"),
44
45
46
47
48
49
50 RETIRED("retired", "http://hl7.org/fhir/resource-profile-status"),
51
52 ;
53
54
55
56
57
58 public static final String VALUESET_IDENTIFIER = "http://hl7.org/fhir/vs/resource-profile-status";
59
60
61
62
63
64 public static final String VALUESET_NAME = "ResourceProfileStatus";
65
66 private static Map<String, ResourceProfileStatusEnum> CODE_TO_ENUM = new HashMap<String, ResourceProfileStatusEnum>();
67 private static Map<String, Map<String, ResourceProfileStatusEnum>> SYSTEM_TO_CODE_TO_ENUM = new HashMap<String, Map<String, ResourceProfileStatusEnum>>();
68
69 private final String myCode;
70 private final String mySystem;
71
72 static {
73 for (ResourceProfileStatusEnum next : ResourceProfileStatusEnum.values()) {
74 CODE_TO_ENUM.put(next.getCode(), next);
75
76 if (!SYSTEM_TO_CODE_TO_ENUM.containsKey(next.getSystem())) {
77 SYSTEM_TO_CODE_TO_ENUM.put(next.getSystem(), new HashMap<String, ResourceProfileStatusEnum>());
78 }
79 SYSTEM_TO_CODE_TO_ENUM.get(next.getSystem()).put(next.getCode(), next);
80 }
81 }
82
83
84
85
86 public String getCode() {
87 return myCode;
88 }
89
90
91
92
93 public String getSystem() {
94 return mySystem;
95 }
96
97
98
99
100 public ResourceProfileStatusEnum forCode(String theCode) {
101 ResourceProfileStatusEnum retVal = CODE_TO_ENUM.get(theCode);
102 return retVal;
103 }
104
105
106
107
108 public static final IValueSetEnumBinder<ResourceProfileStatusEnum> VALUESET_BINDER = new IValueSetEnumBinder<ResourceProfileStatusEnum>() {
109 @Override
110 public String toCodeString(ResourceProfileStatusEnum theEnum) {
111 return theEnum.getCode();
112 }
113
114 @Override
115 public String toSystemString(ResourceProfileStatusEnum theEnum) {
116 return theEnum.getSystem();
117 }
118
119 @Override
120 public ResourceProfileStatusEnum fromCodeString(String theCodeString) {
121 return CODE_TO_ENUM.get(theCodeString);
122 }
123
124 @Override
125 public ResourceProfileStatusEnum fromCodeString(String theCodeString, String theSystemString) {
126 Map<String, ResourceProfileStatusEnum> map = SYSTEM_TO_CODE_TO_ENUM.get(theSystemString);
127 if (map == null) {
128 return null;
129 }
130 return map.get(theCodeString);
131 }
132
133 };
134
135
136
137
138 ResourceProfileStatusEnum(String theCode, String theSystem) {
139 myCode = theCode;
140 mySystem = theSystem;
141 }
142
143
144 }