001package org.hl7.fhir.convertors.conv14_40.resources14_40;
002
003import org.hl7.fhir.convertors.context.ConversionContext14_40;
004import org.hl7.fhir.exceptions.FHIRException;
005
006public class Enumerations14_40 {
007  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.BindingStrength> convertBindingStrength(org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.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    ConversionContext14_40.INSTANCE.getVersionConvertor_14_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.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.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.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength> tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrengthEnumFactory());
038    ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt);
039    if (src.getValue() == null) {
040      tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.NULL);
041    } else {
042      switch (src.getValue()) {
043        case REQUIRED:
044          tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.REQUIRED);
045          break;
046        case EXTENSIBLE:
047          tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.EXTENSIBLE);
048          break;
049        case PREFERRED:
050          tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.PREFERRED);
051          break;
052        case EXAMPLE:
053          tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.BindingStrength.EXAMPLE);
054          break;
055        default:
056          tgt.setValue(org.hl7.fhir.dstu2016may.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> convertConformanceResourceStatus(org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus> 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    ConversionContext14_40.INSTANCE.getVersionConvertor_14_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        default:
081          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.PublicationStatus.NULL);
082          break;
083      }
084    }
085    return tgt;
086  }
087
088  static public org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus> convertConformanceResourceStatus(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.PublicationStatus> src) throws FHIRException {
089    if (src == null || src.isEmpty()) return null;
090    org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus> tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatusEnumFactory());
091    ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt);
092    if (src.getValue() == null) {
093      tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.NULL);
094    } else {
095      switch (src.getValue()) {
096        case DRAFT:
097          tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.DRAFT);
098          break;
099        case ACTIVE:
100          tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.ACTIVE);
101          break;
102        case RETIRED:
103          tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.RETIRED);
104          break;
105        default:
106          tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.ConformanceResourceStatus.NULL);
107          break;
108      }
109    }
110    return tgt;
111  }
112
113  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.SearchParamType> convertSearchParamType(org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType> src) throws FHIRException {
114    if (src == null || src.isEmpty()) return null;
115    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());
116    ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt);
117    if (src.getValue() == null) {
118      tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.NULL);
119    } else {
120      switch (src.getValue()) {
121        case NUMBER:
122          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.NUMBER);
123          break;
124        case DATE:
125          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.DATE);
126          break;
127        case STRING:
128          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.STRING);
129          break;
130        case TOKEN:
131          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.TOKEN);
132          break;
133        case REFERENCE:
134          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.REFERENCE);
135          break;
136        case COMPOSITE:
137          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.COMPOSITE);
138          break;
139        case QUANTITY:
140          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.QUANTITY);
141          break;
142        case URI:
143          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.URI);
144          break;
145        default:
146          tgt.setValue(org.hl7.fhir.r4.model.Enumerations.SearchParamType.NULL);
147          break;
148      }
149    }
150    return tgt;
151  }
152
153  static public org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType> convertSearchParamType(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.Enumerations.SearchParamType> src) throws FHIRException {
154    if (src == null || src.isEmpty()) return null;
155    org.hl7.fhir.dstu2016may.model.Enumeration<org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType> tgt = new org.hl7.fhir.dstu2016may.model.Enumeration<>(new org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamTypeEnumFactory());
156    ConversionContext14_40.INSTANCE.getVersionConvertor_14_40().copyElement(src, tgt);
157    if (src.getValue() == null) {
158      tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.NULL);
159    } else {
160      switch (src.getValue()) {
161        case NUMBER:
162          tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.NUMBER);
163          break;
164        case DATE:
165          tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.DATE);
166          break;
167        case STRING:
168          tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.STRING);
169          break;
170        case TOKEN:
171          tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.TOKEN);
172          break;
173        case REFERENCE:
174          tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.REFERENCE);
175          break;
176        case COMPOSITE:
177          tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.COMPOSITE);
178          break;
179        case QUANTITY:
180          tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.QUANTITY);
181          break;
182        case URI:
183          tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.URI);
184          break;
185        default:
186          tgt.setValue(org.hl7.fhir.dstu2016may.model.Enumerations.SearchParamType.NULL);
187          break;
188      }
189    }
190    return tgt;
191  }
192}