001package org.hl7.fhir.convertors.conv30_40.resources30_40;
002
003import org.hl7.fhir.convertors.context.ConversionContext30_40;
004import org.hl7.fhir.exceptions.FHIRException;
005
006public class Enumerations30_40 {
007  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.BindingStrength> convertBindingStrength(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.BindingStrength> src) throws FHIRException {
008    if (src == null || src.isEmpty()) return null;
009    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.BindingStrength> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.BindingStrengthEnumFactory());
010    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
011    if (src.getValue() == null) {
012      tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.NULL);
013    } else {
014      switch (src.getValue()) {
015        case REQUIRED:
016          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.REQUIRED);
017          break;
018        case EXTENSIBLE:
019          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.EXTENSIBLE);
020          break;
021        case PREFERRED:
022          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.PREFERRED);
023          break;
024        case EXAMPLE:
025          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.EXAMPLE);
026          break;
027        default:
028          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.BindingStrength.NULL);
029          break;
030      }
031    }
032    return tgt;
033  }
034
035  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.BindingStrength> convertBindingStrength(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.BindingStrength> src) throws FHIRException {
036    if (src == null || src.isEmpty()) return null;
037    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.BindingStrength> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.BindingStrengthEnumFactory());
038    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
039    if (src.getValue() == null) {
040      tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.NULL);
041    } else {
042      switch (src.getValue()) {
043        case REQUIRED:
044          tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.REQUIRED);
045          break;
046        case EXTENSIBLE:
047          tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.EXTENSIBLE);
048          break;
049        case PREFERRED:
050          tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.PREFERRED);
051          break;
052        case EXAMPLE:
053          tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.EXAMPLE);
054          break;
055        default:
056          tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.BindingStrength.NULL);
057          break;
058      }
059    }
060    return tgt;
061  }
062
063  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.PublicationStatus> convertPublicationStatus(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus> src) throws FHIRException {
064    if (src == null || src.isEmpty()) return null;
065    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.PublicationStatus> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.PublicationStatusEnumFactory());
066    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
067    if (src.getValue() == null) {
068      tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.NULL);
069    } else {
070      switch (src.getValue()) {
071        case DRAFT:
072          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.DRAFT);
073          break;
074        case ACTIVE:
075          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.ACTIVE);
076          break;
077        case RETIRED:
078          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.RETIRED);
079          break;
080        case UNKNOWN:
081          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.UNKNOWN);
082          break;
083        default:
084          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.NULL);
085          break;
086      }
087    }
088    return tgt;
089  }
090
091  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus> convertPublicationStatus(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.PublicationStatus> src) throws FHIRException {
092    if (src == null || src.isEmpty()) return null;
093    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.PublicationStatusEnumFactory());
094    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
095    if (src.getValue() == null) {
096      tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.NULL);
097    } else {
098      switch (src.getValue()) {
099        case DRAFT:
100          tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.DRAFT);
101          break;
102        case ACTIVE:
103          tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.ACTIVE);
104          break;
105        case RETIRED:
106          tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.RETIRED);
107          break;
108        case UNKNOWN:
109          tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.UNKNOWN);
110          break;
111        default:
112          tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.PublicationStatus.NULL);
113          break;
114      }
115    }
116    return tgt;
117  }
118
119  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.SearchParamType> convertSearchParamType(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.SearchParamType> src) throws FHIRException {
120    if (src == null || src.isEmpty()) return null;
121    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.SearchParamType> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.SearchParamTypeEnumFactory());
122    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
123    if (src.getValue() == null) {
124      tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.NULL);
125    } else {
126      switch (src.getValue()) {
127        case NUMBER:
128          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.NUMBER);
129          break;
130        case DATE:
131          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.DATE);
132          break;
133        case STRING:
134          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.STRING);
135          break;
136        case TOKEN:
137          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.TOKEN);
138          break;
139        case REFERENCE:
140          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.REFERENCE);
141          break;
142        case COMPOSITE:
143          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.COMPOSITE);
144          break;
145        case QUANTITY:
146          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.QUANTITY);
147          break;
148        case URI:
149          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.URI);
150          break;
151        default:
152          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.NULL);
153          break;
154      }
155    }
156    return tgt;
157  }
158
159  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.SearchParamType> convertSearchParamType(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.SearchParamType> src) throws FHIRException {
160    if (src == null || src.isEmpty()) return null;
161    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.SearchParamType> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.SearchParamTypeEnumFactory());
162    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
163    if (src.getValue() == null) {
164      tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.NULL);
165    } else {
166      switch (src.getValue()) {
167        case NUMBER:
168          tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.NUMBER);
169          break;
170        case DATE:
171          tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.DATE);
172          break;
173        case STRING:
174          tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.STRING);
175          break;
176        case TOKEN:
177          tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.TOKEN);
178          break;
179        case REFERENCE:
180          tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.REFERENCE);
181          break;
182        case COMPOSITE:
183          tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.COMPOSITE);
184          break;
185        case QUANTITY:
186          tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.QUANTITY);
187          break;
188        case URI:
189          tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.URI);
190          break;
191        default:
192          tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.SearchParamType.NULL);
193          break;
194      }
195    }
196    return tgt;
197  }
198
199  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.AdministrativeGender> convertAdministrativeGender(org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender> src) throws FHIRException {
200    if (src == null || src.isEmpty()) return null;
201    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.AdministrativeGender> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.Enumerations.AdministrativeGenderEnumFactory());
202    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
203    if (src.getValue() == null) {
204      tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.NULL);
205    } else {
206      switch (src.getValue()) {
207        case MALE:
208          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.MALE);
209          break;
210        case FEMALE:
211          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.FEMALE);
212          break;
213        case OTHER:
214          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.OTHER);
215          break;
216        case UNKNOWN:
217          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.UNKNOWN);
218          break;
219        default:
220          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.AdministrativeGender.NULL);
221          break;
222      }
223    }
224    return tgt;
225  }
226
227  static public org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender> convertAdministrativeGender(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.AdministrativeGender> src) throws FHIRException {
228    if (src == null || src.isEmpty()) return null;
229    org.hl7.fhir.dstu3.model.Enumeration<org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender> tgt = new org.hl7.fhir.dstu3.model.Enumeration<>(new org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGenderEnumFactory());
230    ConversionContext30_40.INSTANCE.getVersionConvertor_30_40().copyElement(src, tgt);
231    if (src.getValue() == null) {
232      tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.NULL);
233    } else {
234      switch (src.getValue()) {
235        case MALE:
236          tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.MALE);
237          break;
238        case FEMALE:
239          tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.FEMALE);
240          break;
241        case OTHER:
242          tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.OTHER);
243          break;
244        case UNKNOWN:
245          tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.UNKNOWN);
246          break;
247        default:
248          tgt.setValue(org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.NULL);
249          break;
250      }
251    }
252    return tgt;
253  }
254}