001package org.hl7.fhir.convertors.conv40_50.resources40_50;
002
003import org.hl7.fhir.convertors.context.ConversionContext40_50;
004import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.Annotation40_50;
005import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.CodeableConcept40_50;
006import org.hl7.fhir.convertors.conv40_50.datatypes40_50.general40_50.Identifier40_50;
007import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.DateTime40_50;
008import org.hl7.fhir.convertors.conv40_50.datatypes40_50.primitive40_50.String40_50;
009import org.hl7.fhir.convertors.conv40_50.datatypes40_50.special40_50.Reference40_50;
010import org.hl7.fhir.exceptions.FHIRException;
011import org.hl7.fhir.r5.model.CodeableReference;
012
013import java.util.stream.Collectors;
014
015/*
016  Copyright (c) 2011+, HL7, Inc.
017  All rights reserved.
018  
019  Redistribution and use in source and binary forms, with or without modification, 
020  are permitted provided that the following conditions are met:
021  
022   * Redistributions of source code must retain the above copyright notice, this 
023     list of conditions and the following disclaimer.
024   * Redistributions in binary form must reproduce the above copyright notice, 
025     this list of conditions and the following disclaimer in the documentation 
026     and/or other materials provided with the distribution.
027   * Neither the name of HL7 nor the names of its contributors may be used to 
028     endorse or promote products derived from this software without specific 
029     prior written permission.
030  
031  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
032  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
033  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
034  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
035  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
036  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
037  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
038  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
039  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
040  POSSIBILITY OF SUCH DAMAGE.
041  
042*/
043// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
044public class AllergyIntolerance40_50 {
045
046  public static org.hl7.fhir.r5.model.AllergyIntolerance convertAllergyIntolerance(org.hl7.fhir.r4.model.AllergyIntolerance src) throws FHIRException {
047    if (src == null)
048      return null;
049    org.hl7.fhir.r5.model.AllergyIntolerance tgt = new org.hl7.fhir.r5.model.AllergyIntolerance();
050    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt);
051    for (org.hl7.fhir.r4.model.Identifier t : src.getIdentifier())
052      tgt.addIdentifier(Identifier40_50.convertIdentifier(t));
053    if (src.hasClinicalStatus())
054      tgt.setClinicalStatus(CodeableConcept40_50.convertCodeableConcept(src.getClinicalStatus()));
055    if (src.hasVerificationStatus())
056      tgt.setVerificationStatus(CodeableConcept40_50.convertCodeableConcept(src.getVerificationStatus()));
057    if (src.hasType())
058      tgt.setTypeElement(convertAllergyIntoleranceType(src.getTypeElement()));
059    tgt.setCategory(src.getCategory().stream()
060      .map(AllergyIntolerance40_50::convertAllergyIntoleranceCategory)
061      .collect(Collectors.toList()));
062    if (src.hasCriticality())
063      tgt.setCriticalityElement(convertAllergyIntoleranceCriticality(src.getCriticalityElement()));
064    if (src.hasCode())
065      tgt.setCode(CodeableConcept40_50.convertCodeableConcept(src.getCode()));
066    if (src.hasPatient())
067      tgt.setPatient(Reference40_50.convertReference(src.getPatient()));
068    if (src.hasEncounter())
069      tgt.setEncounter(Reference40_50.convertReference(src.getEncounter()));
070    if (src.hasOnset())
071      tgt.setOnset(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getOnset()));
072    if (src.hasRecordedDate())
073      tgt.setRecordedDateElement(DateTime40_50.convertDateTime(src.getRecordedDateElement()));
074    if (src.hasRecorder())
075      tgt.setRecorder(Reference40_50.convertReference(src.getRecorder()));
076    if (src.hasAsserter())
077      tgt.setAsserter(Reference40_50.convertReference(src.getAsserter()));
078    if (src.hasLastOccurrence())
079      tgt.setLastOccurrenceElement(DateTime40_50.convertDateTime(src.getLastOccurrenceElement()));
080    for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(Annotation40_50.convertAnnotation(t));
081    for (org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceReactionComponent t : src.getReaction())
082      tgt.addReaction(convertAllergyIntoleranceReactionComponent(t));
083    return tgt;
084  }
085
086  public static org.hl7.fhir.r4.model.AllergyIntolerance convertAllergyIntolerance(org.hl7.fhir.r5.model.AllergyIntolerance src) throws FHIRException {
087    if (src == null)
088      return null;
089    org.hl7.fhir.r4.model.AllergyIntolerance tgt = new org.hl7.fhir.r4.model.AllergyIntolerance();
090    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyDomainResource(src, tgt);
091    for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
092      tgt.addIdentifier(Identifier40_50.convertIdentifier(t));
093    if (src.hasClinicalStatus())
094      tgt.setClinicalStatus(CodeableConcept40_50.convertCodeableConcept(src.getClinicalStatus()));
095    if (src.hasVerificationStatus())
096      tgt.setVerificationStatus(CodeableConcept40_50.convertCodeableConcept(src.getVerificationStatus()));
097    if (src.hasType())
098      tgt.setTypeElement(convertAllergyIntoleranceType(src.getTypeElement()));
099    tgt.setCategory(src.getCategory().stream()
100      .map(AllergyIntolerance40_50::convertAllergyIntoleranceCategory)
101      .collect(Collectors.toList()));
102    if (src.hasCriticality())
103      tgt.setCriticalityElement(convertAllergyIntoleranceCriticality(src.getCriticalityElement()));
104    if (src.hasCode())
105      tgt.setCode(CodeableConcept40_50.convertCodeableConcept(src.getCode()));
106    if (src.hasPatient())
107      tgt.setPatient(Reference40_50.convertReference(src.getPatient()));
108    if (src.hasEncounter())
109      tgt.setEncounter(Reference40_50.convertReference(src.getEncounter()));
110    if (src.hasOnset())
111      tgt.setOnset(ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().convertType(src.getOnset()));
112    if (src.hasRecordedDate())
113      tgt.setRecordedDateElement(DateTime40_50.convertDateTime(src.getRecordedDateElement()));
114    if (src.hasRecorder())
115      tgt.setRecorder(Reference40_50.convertReference(src.getRecorder()));
116    if (src.hasAsserter())
117      tgt.setAsserter(Reference40_50.convertReference(src.getAsserter()));
118    if (src.hasLastOccurrence())
119      tgt.setLastOccurrenceElement(DateTime40_50.convertDateTime(src.getLastOccurrenceElement()));
120    for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation40_50.convertAnnotation(t));
121    for (org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent t : src.getReaction())
122      tgt.addReaction(convertAllergyIntoleranceReactionComponent(t));
123    return tgt;
124  }
125
126  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceType> convertAllergyIntoleranceType(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceType> src) throws FHIRException {
127    if (src == null || src.isEmpty())
128      return null;
129    org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceType> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceTypeEnumFactory());
130    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
131    switch (src.getValue()) {
132      case ALLERGY:
133        tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceType.ALLERGY);
134        break;
135      case INTOLERANCE:
136        tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceType.INTOLERANCE);
137        break;
138      default:
139        tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceType.NULL);
140        break;
141    }
142    return tgt;
143  }
144
145  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceType> convertAllergyIntoleranceType(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceType> src) throws FHIRException {
146    if (src == null || src.isEmpty())
147      return null;
148    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceType> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceTypeEnumFactory());
149    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
150    switch (src.getValue()) {
151      case ALLERGY:
152        tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceType.ALLERGY);
153        break;
154      case INTOLERANCE:
155        tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceType.INTOLERANCE);
156        break;
157      default:
158        tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceType.NULL);
159        break;
160    }
161    return tgt;
162  }
163
164  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory> convertAllergyIntoleranceCategory(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory> src) throws FHIRException {
165    if (src == null || src.isEmpty())
166      return null;
167    org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategoryEnumFactory());
168    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
169    switch (src.getValue()) {
170      case FOOD:
171        tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.FOOD);
172        break;
173      case MEDICATION:
174        tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.MEDICATION);
175        break;
176      case ENVIRONMENT:
177        tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.ENVIRONMENT);
178        break;
179      case BIOLOGIC:
180        tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.BIOLOGIC);
181        break;
182      default:
183        tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory.NULL);
184        break;
185    }
186    return tgt;
187  }
188
189  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory> convertAllergyIntoleranceCategory(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCategory> src) throws FHIRException {
190    if (src == null || src.isEmpty())
191      return null;
192    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategoryEnumFactory());
193    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
194    switch (src.getValue()) {
195      case FOOD:
196        tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.FOOD);
197        break;
198      case MEDICATION:
199        tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.MEDICATION);
200        break;
201      case ENVIRONMENT:
202        tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.ENVIRONMENT);
203        break;
204      case BIOLOGIC:
205        tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.BIOLOGIC);
206        break;
207      default:
208        tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCategory.NULL);
209        break;
210    }
211    return tgt;
212  }
213
214  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality> convertAllergyIntoleranceCriticality(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality> src) throws FHIRException {
215    if (src == null || src.isEmpty())
216      return null;
217    org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticalityEnumFactory());
218    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
219    switch (src.getValue()) {
220      case LOW:
221        tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.LOW);
222        break;
223      case HIGH:
224        tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.HIGH);
225        break;
226      case UNABLETOASSESS:
227        tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.UNABLETOASSESS);
228        break;
229      default:
230        tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality.NULL);
231        break;
232    }
233    return tgt;
234  }
235
236  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality> convertAllergyIntoleranceCriticality(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceCriticality> src) throws FHIRException {
237    if (src == null || src.isEmpty())
238      return null;
239    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticalityEnumFactory());
240    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
241    switch (src.getValue()) {
242      case LOW:
243        tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality.LOW);
244        break;
245      case HIGH:
246        tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality.HIGH);
247        break;
248      case UNABLETOASSESS:
249        tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality.UNABLETOASSESS);
250        break;
251      default:
252        tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceCriticality.NULL);
253        break;
254    }
255    return tgt;
256  }
257
258  public static org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent convertAllergyIntoleranceReactionComponent(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceReactionComponent src) throws FHIRException {
259    if (src == null)
260      return null;
261    org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent tgt = new org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent();
262    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
263    if (src.hasSubstance())
264      tgt.setSubstance(CodeableConcept40_50.convertCodeableConcept(src.getSubstance()));
265    for (org.hl7.fhir.r4.model.CodeableConcept t : src.getManifestation())
266      tgt.addManifestation(new CodeableReference(CodeableConcept40_50.convertCodeableConcept(t)));
267    if (src.hasDescription())
268      tgt.setDescriptionElement(String40_50.convertString(src.getDescriptionElement()));
269    if (src.hasOnset())
270      tgt.setOnsetElement(DateTime40_50.convertDateTime(src.getOnsetElement()));
271    if (src.hasSeverity())
272      tgt.setSeverityElement(convertAllergyIntoleranceSeverity(src.getSeverityElement()));
273    if (src.hasExposureRoute())
274      tgt.setExposureRoute(CodeableConcept40_50.convertCodeableConcept(src.getExposureRoute()));
275    for (org.hl7.fhir.r4.model.Annotation t : src.getNote()) tgt.addNote(Annotation40_50.convertAnnotation(t));
276    return tgt;
277  }
278
279  public static org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceReactionComponent convertAllergyIntoleranceReactionComponent(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceReactionComponent src) throws FHIRException {
280    if (src == null)
281      return null;
282    org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceReactionComponent tgt = new org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceReactionComponent();
283    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
284    if (src.hasSubstance())
285      tgt.setSubstance(CodeableConcept40_50.convertCodeableConcept(src.getSubstance()));
286    for (CodeableReference t : src.getManifestation())
287      if (t.hasConcept()) tgt.addManifestation(CodeableConcept40_50.convertCodeableConcept(t.getConcept()));
288    if (src.hasDescription())
289      tgt.setDescriptionElement(String40_50.convertString(src.getDescriptionElement()));
290    if (src.hasOnset())
291      tgt.setOnsetElement(DateTime40_50.convertDateTime(src.getOnsetElement()));
292    if (src.hasSeverity())
293      tgt.setSeverityElement(convertAllergyIntoleranceSeverity(src.getSeverityElement()));
294    if (src.hasExposureRoute())
295      tgt.setExposureRoute(CodeableConcept40_50.convertCodeableConcept(src.getExposureRoute()));
296    for (org.hl7.fhir.r5.model.Annotation t : src.getNote()) tgt.addNote(Annotation40_50.convertAnnotation(t));
297    return tgt;
298  }
299
300  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity> convertAllergyIntoleranceSeverity(org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity> src) throws FHIRException {
301    if (src == null || src.isEmpty())
302      return null;
303    org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity> tgt = new org.hl7.fhir.r5.model.Enumeration<>(new org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverityEnumFactory());
304    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
305    switch (src.getValue()) {
306      case MILD:
307        tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.MILD);
308        break;
309      case MODERATE:
310        tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.MODERATE);
311        break;
312      case SEVERE:
313        tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.SEVERE);
314        break;
315      default:
316        tgt.setValue(org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity.NULL);
317        break;
318    }
319    return tgt;
320  }
321
322  static public org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity> convertAllergyIntoleranceSeverity(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.AllergyIntolerance.AllergyIntoleranceSeverity> src) throws FHIRException {
323    if (src == null || src.isEmpty())
324      return null;
325    org.hl7.fhir.r4.model.Enumeration<org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity> tgt = new org.hl7.fhir.r4.model.Enumeration<>(new org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverityEnumFactory());
326    ConversionContext40_50.INSTANCE.getVersionConvertor_40_50().copyElement(src, tgt);
327    switch (src.getValue()) {
328      case MILD:
329        tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity.MILD);
330        break;
331      case MODERATE:
332        tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity.MODERATE);
333        break;
334      case SEVERE:
335        tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity.SEVERE);
336        break;
337      default:
338        tgt.setValue(org.hl7.fhir.r4.model.AllergyIntolerance.AllergyIntoleranceSeverity.NULL);
339        break;
340    }
341    return tgt;
342  }
343}