001package org.hl7.fhir.convertors.conv43_50.resources43_50;
002
003import org.hl7.fhir.convertors.context.ConversionContext43_50;
004import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Extension43_50;
005import org.hl7.fhir.exceptions.FHIRException;
006import org.hl7.fhir.r5.model.DocumentReference;
007import org.hl7.fhir.r5.model.Enumeration;
008import org.hl7.fhir.r5.model.Enumerations;
009import org.hl7.fhir.r5.model.PaymentReconciliation;
010
011/*
012  Copyright (c) 2011+, HL7, Inc.
013  All rights reserved.
014  
015  Redistribution and use in source and binary forms, with or without modification, 
016  are permitted provided that the following conditions are met:
017  
018   * Redistributions of source code must retain the above copyright notice, this 
019     list of conditions and the following disclaimer.
020   * Redistributions in binary form must reproduce the above copyright notice, 
021     this list of conditions and the following disclaimer in the documentation 
022     and/or other materials provided with the distribution.
023   * Neither the name of HL7 nor the names of its contributors may be used to 
024     endorse or promote products derived from this software without specific 
025     prior written permission.
026  
027  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
028  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
029  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
030  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
031  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
032  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
033  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
034  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
035  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
036  POSSIBILITY OF SUCH DAMAGE.
037  
038*/
039// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
040public class Enumerations43_50 {
041
042  public static void copyEnumeration(org.hl7.fhir.r4b.model.Enumeration<?> src, org.hl7.fhir.r5.model.Enumeration<?> tgt) throws FHIRException {
043    if (src.hasId()) tgt.setId(src.getId());
044    for (org.hl7.fhir.r4b.model.Extension e : src.getExtension()) {
045      tgt.addExtension(Extension43_50.convertExtension(e));
046    }
047  }
048
049  public static void copyEnumeration(org.hl7.fhir.r5.model.Enumeration<?> src, org.hl7.fhir.r4b.model.Enumeration<?> tgt) throws FHIRException {
050    if (src.hasId()) tgt.setId(src.getId());
051    for (org.hl7.fhir.r5.model.Extension e : src.getExtension()) {
052      tgt.addExtension(Extension43_50.convertExtension(e));
053    }
054  }
055
056  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.BindingStrength> convertBindingStrength(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.BindingStrength> src) throws FHIRException {
057      if (src == null || src.isEmpty())
058          return null;
059      Enumeration<Enumerations.BindingStrength> tgt = new Enumeration<>(new Enumerations.BindingStrengthEnumFactory());
060      ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
061      if (src.getValue() == null) {
062          tgt.setValue(null);
063      } else {
064          switch (src.getValue()) {
065              case REQUIRED:
066                  tgt.setValue(Enumerations.BindingStrength.REQUIRED);
067                  break;
068              case EXTENSIBLE:
069                  tgt.setValue(Enumerations.BindingStrength.EXTENSIBLE);
070                  break;
071              case PREFERRED:
072                  tgt.setValue(Enumerations.BindingStrength.PREFERRED);
073                  break;
074              case EXAMPLE:
075                  tgt.setValue(Enumerations.BindingStrength.EXAMPLE);
076                  break;
077              default:
078                  tgt.setValue(Enumerations.BindingStrength.NULL);
079                  break;
080          }
081      }
082      return tgt;
083  }
084
085  static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.BindingStrength> convertBindingStrength(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.BindingStrength> src) throws FHIRException {
086      if (src == null || src.isEmpty())
087          return null;
088      org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.BindingStrength> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.BindingStrengthEnumFactory());
089      ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
090      if (src.getValue() == null) {
091          tgt.setValue(null);
092      } else {
093          switch (src.getValue()) {
094              case REQUIRED:
095                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.BindingStrength.REQUIRED);
096                  break;
097              case EXTENSIBLE:
098                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.BindingStrength.EXTENSIBLE);
099                  break;
100              case PREFERRED:
101                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.BindingStrength.PREFERRED);
102                  break;
103              case EXAMPLE:
104                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.BindingStrength.EXAMPLE);
105                  break;
106              default:
107                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.BindingStrength.NULL);
108                  break;
109          }
110      }
111      return tgt;
112  }
113
114  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.PublicationStatus> convertPublicationStatus(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.PublicationStatus> src) throws FHIRException {
115      if (src == null || src.isEmpty())
116          return null;
117      Enumeration<Enumerations.PublicationStatus> tgt = new Enumeration<>(new Enumerations.PublicationStatusEnumFactory());
118      ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
119      if (src.getValue() == null) {
120          tgt.setValue(null);
121      } else {
122          switch (src.getValue()) {
123              case DRAFT:
124                  tgt.setValue(Enumerations.PublicationStatus.DRAFT);
125                  break;
126              case ACTIVE:
127                  tgt.setValue(Enumerations.PublicationStatus.ACTIVE);
128                  break;
129              case RETIRED:
130                  tgt.setValue(Enumerations.PublicationStatus.RETIRED);
131                  break;
132              case UNKNOWN:
133                  tgt.setValue(Enumerations.PublicationStatus.UNKNOWN);
134                  break;
135              default:
136                  tgt.setValue(Enumerations.PublicationStatus.NULL);
137                  break;
138          }
139      }
140      return tgt;
141  }
142
143  static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.PublicationStatus> convertPublicationStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.PublicationStatus> src) throws FHIRException {
144      if (src == null || src.isEmpty())
145          return null;
146      org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.PublicationStatus> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.PublicationStatusEnumFactory());
147      ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
148      if (src.getValue() == null) {
149          tgt.setValue(null);
150      } else {
151          switch (src.getValue()) {
152              case DRAFT:
153                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.PublicationStatus.DRAFT);
154                  break;
155              case ACTIVE:
156                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.PublicationStatus.ACTIVE);
157                  break;
158              case RETIRED:
159                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.PublicationStatus.RETIRED);
160                  break;
161              case UNKNOWN:
162                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.PublicationStatus.UNKNOWN);
163                  break;
164              default:
165                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.PublicationStatus.NULL);
166                  break;
167          }
168      }
169      return tgt;
170  }
171
172  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.FHIRVersion> convertFHIRVersion(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.FHIRVersion> src) throws FHIRException {
173      if (src == null || src.isEmpty())
174          return null;
175      Enumeration<Enumerations.FHIRVersion> tgt = new Enumeration<>(new Enumerations.FHIRVersionEnumFactory());
176      ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
177      if (src.getValue() == null) {
178          tgt.setValue(null);
179      } else {
180          switch (src.getValue()) {
181              case _0_01:
182                  tgt.setValue(Enumerations.FHIRVersion._0_01);
183                  break;
184              case _0_05:
185                  tgt.setValue(Enumerations.FHIRVersion._0_05);
186                  break;
187              case _0_06:
188                  tgt.setValue(Enumerations.FHIRVersion._0_06);
189                  break;
190              case _0_11:
191                  tgt.setValue(Enumerations.FHIRVersion._0_11);
192                  break;
193              case _0_0_80:
194                  tgt.setValue(Enumerations.FHIRVersion._0_0_80);
195                  break;
196              case _0_0_81:
197                  tgt.setValue(Enumerations.FHIRVersion._0_0_81);
198                  break;
199              case _0_0_82:
200                  tgt.setValue(Enumerations.FHIRVersion._0_0_82);
201                  break;
202              case _0_4_0:
203                  tgt.setValue(Enumerations.FHIRVersion._0_4_0);
204                  break;
205              case _0_5_0:
206                  tgt.setValue(Enumerations.FHIRVersion._0_5_0);
207                  break;
208              case _1_0_0:
209                  tgt.setValue(Enumerations.FHIRVersion._1_0_0);
210                  break;
211              case _1_0_1:
212                  tgt.setValue(Enumerations.FHIRVersion._1_0_1);
213                  break;
214              case _1_0_2:
215                  tgt.setValue(Enumerations.FHIRVersion._1_0_2);
216                  break;
217              case _1_1_0:
218                  tgt.setValue(Enumerations.FHIRVersion._1_1_0);
219                  break;
220              case _1_4_0:
221                  tgt.setValue(Enumerations.FHIRVersion._1_4_0);
222                  break;
223              case _1_6_0:
224                  tgt.setValue(Enumerations.FHIRVersion._1_6_0);
225                  break;
226              case _1_8_0:
227                  tgt.setValue(Enumerations.FHIRVersion._1_8_0);
228                  break;
229              case _3_0_0:
230                  tgt.setValue(Enumerations.FHIRVersion._3_0_0);
231                  break;
232              case _3_0_1:
233                  tgt.setValue(Enumerations.FHIRVersion._3_0_1);
234                  break;
235              case _3_0_2:
236                  tgt.setValue(Enumerations.FHIRVersion._3_0_2);
237                  break;
238              case _3_3_0:
239                  tgt.setValue(Enumerations.FHIRVersion._3_3_0);
240                  break;
241              case _3_5_0:
242                  tgt.setValue(Enumerations.FHIRVersion._3_5_0);
243                  break;
244              case _4_0_0:
245                  tgt.setValue(Enumerations.FHIRVersion._4_0_0);
246                  break;
247              case _4_0_1:
248                  tgt.setValue(Enumerations.FHIRVersion._4_0_1);
249                  break;
250              case _4_1_0:
251                  tgt.setValue(Enumerations.FHIRVersion._4_1_0);
252                  break;
253              case _4_3_0:
254                  tgt.setValue(Enumerations.FHIRVersion._4_3_0);
255                  break;
256              default:
257                  tgt.setValue(Enumerations.FHIRVersion.NULL);
258                  break;
259          }
260      }
261      return tgt;
262  }
263
264  static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.FHIRVersion> convertFHIRVersion(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.FHIRVersion> src) throws FHIRException {
265      if (src == null || src.isEmpty())
266          return null;
267      org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.FHIRVersion> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.FHIRVersionEnumFactory());
268      ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
269      if (src.getValue() == null) {
270          tgt.setValue(null);
271      } else {
272          switch (src.getValue()) {
273              case _0_01:
274                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._0_01);
275                  break;
276              case _0_05:
277                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._0_05);
278                  break;
279              case _0_06:
280                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._0_06);
281                  break;
282              case _0_11:
283                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._0_11);
284                  break;
285              case _0_0_80:
286                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._0_0_80);
287                  break;
288              case _0_0_81:
289                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._0_0_81);
290                  break;
291              case _0_0_82:
292                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._0_0_82);
293                  break;
294              case _0_4_0:
295                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._0_4_0);
296                  break;
297              case _0_5_0:
298                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._0_5_0);
299                  break;
300              case _1_0_0:
301                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._1_0_0);
302                  break;
303              case _1_0_1:
304                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._1_0_1);
305                  break;
306              case _1_0_2:
307                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._1_0_2);
308                  break;
309              case _1_1_0:
310                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._1_1_0);
311                  break;
312              case _1_4_0:
313                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._1_4_0);
314                  break;
315              case _1_6_0:
316                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._1_6_0);
317                  break;
318              case _1_8_0:
319                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._1_8_0);
320                  break;
321              case _3_0_0:
322                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._3_0_0);
323                  break;
324              case _3_0_1:
325                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._3_0_1);
326                  break;
327              case _3_0_2:
328                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._3_0_2);
329                  break;
330              case _3_3_0:
331                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._3_3_0);
332                  break;
333              case _3_5_0:
334                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._3_5_0);
335                  break;
336              case _4_0_0:
337                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._4_0_0);
338                  break;
339              case _4_0_1:
340                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._4_0_1);
341                  break;
342              case _4_1_0:
343                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._4_1_0);
344                  break;
345              case _4_3_0:
346                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion._4_3_0);
347                  break;
348              default:
349                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FHIRVersion.NULL);
350                  break;
351          }
352      }
353      return tgt;
354  }
355
356  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.SearchParamType> convertSearchParamType(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.SearchParamType> src) throws FHIRException {
357      if (src == null || src.isEmpty())
358          return null;
359      Enumeration<Enumerations.SearchParamType> tgt = new Enumeration<>(new Enumerations.SearchParamTypeEnumFactory());
360      ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
361      if (src.getValue() == null) {
362          tgt.setValue(null);
363      } else {
364          switch (src.getValue()) {
365              case NUMBER:
366                  tgt.setValue(Enumerations.SearchParamType.NUMBER);
367                  break;
368              case DATE:
369                  tgt.setValue(Enumerations.SearchParamType.DATE);
370                  break;
371              case STRING:
372                  tgt.setValue(Enumerations.SearchParamType.STRING);
373                  break;
374              case TOKEN:
375                  tgt.setValue(Enumerations.SearchParamType.TOKEN);
376                  break;
377              case REFERENCE:
378                  tgt.setValue(Enumerations.SearchParamType.REFERENCE);
379                  break;
380              case COMPOSITE:
381                  tgt.setValue(Enumerations.SearchParamType.COMPOSITE);
382                  break;
383              case QUANTITY:
384                  tgt.setValue(Enumerations.SearchParamType.QUANTITY);
385                  break;
386              case URI:
387                  tgt.setValue(Enumerations.SearchParamType.URI);
388                  break;
389              case SPECIAL:
390                  tgt.setValue(Enumerations.SearchParamType.SPECIAL);
391                  break;
392              default:
393                  tgt.setValue(Enumerations.SearchParamType.NULL);
394                  break;
395          }
396      }
397      return tgt;
398  }
399
400  static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.SearchParamType> convertSearchParamType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.SearchParamType> src) throws FHIRException {
401      if (src == null || src.isEmpty())
402          return null;
403      org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.SearchParamType> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.SearchParamTypeEnumFactory());
404      ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
405      if (src.getValue() == null) {
406          tgt.setValue(null);
407      } else {
408          switch (src.getValue()) {
409              case NUMBER:
410                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.SearchParamType.NUMBER);
411                  break;
412              case DATE:
413                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.SearchParamType.DATE);
414                  break;
415              case STRING:
416                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.SearchParamType.STRING);
417                  break;
418              case TOKEN:
419                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.SearchParamType.TOKEN);
420                  break;
421              case REFERENCE:
422                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.SearchParamType.REFERENCE);
423                  break;
424              case COMPOSITE:
425                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.SearchParamType.COMPOSITE);
426                  break;
427              case QUANTITY:
428                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.SearchParamType.QUANTITY);
429                  break;
430              case URI:
431                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.SearchParamType.URI);
432                  break;
433              case SPECIAL:
434                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.SearchParamType.SPECIAL);
435                  break;
436              default:
437                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.SearchParamType.NULL);
438                  break;
439          }
440      }
441      return tgt;
442  }
443
444  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.PaymentReconciliation.NoteType> convertNoteType(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.NoteType> src) throws FHIRException {
445      if (src == null || src.isEmpty())
446          return null;
447      Enumeration<PaymentReconciliation.NoteType> tgt = new Enumeration<>(new PaymentReconciliation.NoteTypeEnumFactory());
448      ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
449      if (src.getValue() == null) {
450          tgt.setValue(null);
451      } else {
452          switch (src.getValue()) {
453              case DISPLAY:
454                  tgt.setValue(PaymentReconciliation.NoteType.DISPLAY);
455                  break;
456              case PRINT:
457                  tgt.setValue(PaymentReconciliation.NoteType.PRINT);
458                  break;
459              case PRINTOPER:
460                  tgt.setValue(PaymentReconciliation.NoteType.PRINTOPER);
461                  break;
462              default:
463                  tgt.setValue(PaymentReconciliation.NoteType.NULL);
464                  break;
465          }
466      }
467      return tgt;
468  }
469
470  static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.NoteType> convertNoteType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.PaymentReconciliation.NoteType> src) throws FHIRException {
471      if (src == null || src.isEmpty())
472          return null;
473      org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.NoteType> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.NoteTypeEnumFactory());
474      ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
475      if (src.getValue() == null) {
476          tgt.setValue(null);
477      } else {
478          switch (src.getValue()) {
479              case DISPLAY:
480                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.NoteType.DISPLAY);
481                  break;
482              case PRINT:
483                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.NoteType.PRINT);
484                  break;
485              case PRINTOPER:
486                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.NoteType.PRINTOPER);
487                  break;
488              default:
489                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.NoteType.NULL);
490                  break;
491          }
492      }
493      return tgt;
494  }
495
496  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceStatus> convertDocumentReferenceStatus(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.DocumentReferenceStatus> src) throws FHIRException {
497      if (src == null || src.isEmpty())
498          return null;
499      Enumeration<DocumentReference.DocumentReferenceStatus> tgt = new Enumeration<>(new DocumentReference.DocumentReferenceStatusEnumFactory());
500      ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
501      if (src.getValue() == null) {
502          tgt.setValue(null);
503      } else {
504          switch (src.getValue()) {
505              case CURRENT:
506                  tgt.setValue(DocumentReference.DocumentReferenceStatus.CURRENT);
507                  break;
508              case SUPERSEDED:
509                  tgt.setValue(DocumentReference.DocumentReferenceStatus.SUPERSEDED);
510                  break;
511              case ENTEREDINERROR:
512                  tgt.setValue(DocumentReference.DocumentReferenceStatus.ENTEREDINERROR);
513                  break;
514              default:
515                  tgt.setValue(DocumentReference.DocumentReferenceStatus.NULL);
516                  break;
517          }
518      }
519      return tgt;
520  }
521
522  static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.DocumentReferenceStatus> convertDocumentReferenceStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.DocumentReference.DocumentReferenceStatus> src) throws FHIRException {
523      if (src == null || src.isEmpty())
524          return null;
525      org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.DocumentReferenceStatus> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.DocumentReferenceStatusEnumFactory());
526      ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
527      if (src.getValue() == null) {
528          tgt.setValue(null);
529      } else {
530          switch (src.getValue()) {
531              case CURRENT:
532                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DocumentReferenceStatus.CURRENT);
533                  break;
534              case SUPERSEDED:
535                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DocumentReferenceStatus.SUPERSEDED);
536                  break;
537              case ENTEREDINERROR:
538                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DocumentReferenceStatus.ENTEREDINERROR);
539                  break;
540              default:
541                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.DocumentReferenceStatus.NULL);
542                  break;
543          }
544      }
545      return tgt;
546  }
547
548  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.AdministrativeGender> convertAdministrativeGender(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.AdministrativeGender> src) throws FHIRException {
549      if (src == null || src.isEmpty())
550          return null;
551      Enumeration<Enumerations.AdministrativeGender> tgt = new Enumeration<>(new Enumerations.AdministrativeGenderEnumFactory());
552      ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
553      if (src.getValue() == null) {
554          tgt.setValue(null);
555      } else {
556          switch (src.getValue()) {
557              case MALE:
558                  tgt.setValue(Enumerations.AdministrativeGender.MALE);
559                  break;
560              case FEMALE:
561                  tgt.setValue(Enumerations.AdministrativeGender.FEMALE);
562                  break;
563              case OTHER:
564                  tgt.setValue(Enumerations.AdministrativeGender.OTHER);
565                  break;
566              case UNKNOWN:
567                  tgt.setValue(Enumerations.AdministrativeGender.UNKNOWN);
568                  break;
569              default:
570                  tgt.setValue(Enumerations.AdministrativeGender.NULL);
571                  break;
572          }
573      }
574      return tgt;
575  }
576
577  static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.AdministrativeGender> convertAdministrativeGender(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.AdministrativeGender> src) throws FHIRException {
578      if (src == null || src.isEmpty())
579          return null;
580      org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.AdministrativeGender> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.AdministrativeGenderEnumFactory());
581      ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
582      if (src.getValue() == null) {
583          tgt.setValue(null);
584      } else {
585          switch (src.getValue()) {
586              case MALE:
587                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.AdministrativeGender.MALE);
588                  break;
589              case FEMALE:
590                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.AdministrativeGender.FEMALE);
591                  break;
592              case OTHER:
593                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.AdministrativeGender.OTHER);
594                  break;
595              case UNKNOWN:
596                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.AdministrativeGender.UNKNOWN);
597                  break;
598              default:
599                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.AdministrativeGender.NULL);
600                  break;
601          }
602      }
603      return tgt;
604  }
605
606}