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.general43_50.Attachment43_50;
005import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.CodeableConcept43_50;
006import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Identifier43_50;
007import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Money43_50;
008import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.Period43_50;
009import org.hl7.fhir.convertors.conv43_50.datatypes43_50.general43_50.SimpleQuantity43_50;
010import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Boolean43_50;
011import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Date43_50;
012import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.DateTime43_50;
013import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Decimal43_50;
014import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.PositiveInt43_50;
015import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.String43_50;
016import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Reference43_50;
017import org.hl7.fhir.exceptions.FHIRException;
018import org.hl7.fhir.r5.model.Enumeration;
019import org.hl7.fhir.r5.model.Enumerations;
020
021/*
022  Copyright (c) 2011+, HL7, Inc.
023  All rights reserved.
024  
025  Redistribution and use in source and binary forms, with or without modification, 
026  are permitted provided that the following conditions are met:
027  
028   * Redistributions of source code must retain the above copyright notice, this 
029     list of conditions and the following disclaimer.
030   * Redistributions in binary form must reproduce the above copyright notice, 
031     this list of conditions and the following disclaimer in the documentation 
032     and/or other materials provided with the distribution.
033   * Neither the name of HL7 nor the names of its contributors may be used to 
034     endorse or promote products derived from this software without specific 
035     prior written permission.
036  
037  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
038  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
039  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
040  IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
041  INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
042  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
043  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
044  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
045  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
046  POSSIBILITY OF SUCH DAMAGE.
047  
048*/
049// Generated on Sun, Feb 24, 2019 11:37+1100 for FHIR v4.0.0
050public class ClaimResponse43_50 {
051
052  public static org.hl7.fhir.r5.model.ClaimResponse convertClaimResponse(org.hl7.fhir.r4b.model.ClaimResponse src) throws FHIRException {
053    if (src == null)
054      return null;
055    org.hl7.fhir.r5.model.ClaimResponse tgt = new org.hl7.fhir.r5.model.ClaimResponse();
056    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
057    for (org.hl7.fhir.r4b.model.Identifier t : src.getIdentifier())
058      tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
059    if (src.hasStatus())
060      tgt.setStatusElement(convertClaimResponseStatus(src.getStatusElement()));
061    if (src.hasType())
062      tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
063    if (src.hasSubType())
064      tgt.setSubType(CodeableConcept43_50.convertCodeableConcept(src.getSubType()));
065    if (src.hasUse())
066      tgt.setUseElement(convertUse(src.getUseElement()));
067    if (src.hasPatient())
068      tgt.setPatient(Reference43_50.convertReference(src.getPatient()));
069    if (src.hasCreated())
070      tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement()));
071    if (src.hasInsurer())
072      tgt.setInsurer(Reference43_50.convertReference(src.getInsurer()));
073    if (src.hasRequestor())
074      tgt.setRequestor(Reference43_50.convertReference(src.getRequestor()));
075    if (src.hasRequest())
076      tgt.setRequest(Reference43_50.convertReference(src.getRequest()));
077    if (src.hasOutcome())
078      tgt.setOutcomeElement(convertRemittanceOutcome(src.getOutcomeElement()));
079    if (src.hasDisposition())
080      tgt.setDispositionElement(String43_50.convertString(src.getDispositionElement()));
081    if (src.hasPreAuthRef())
082      tgt.setPreAuthRefElement(String43_50.convertString(src.getPreAuthRefElement()));
083    if (src.hasPreAuthPeriod())
084      tgt.setPreAuthPeriod(Period43_50.convertPeriod(src.getPreAuthPeriod()));
085    if (src.hasPayeeType())
086      tgt.setPayeeType(CodeableConcept43_50.convertCodeableConcept(src.getPayeeType()));
087    for (org.hl7.fhir.r4b.model.ClaimResponse.ItemComponent t : src.getItem()) tgt.addItem(convertItemComponent(t));
088    for (org.hl7.fhir.r4b.model.ClaimResponse.AddedItemComponent t : src.getAddItem())
089      tgt.addAddItem(convertAddedItemComponent(t));
090    for (org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
091      tgt.addAdjudication(convertAdjudicationComponent(t));
092    for (org.hl7.fhir.r4b.model.ClaimResponse.TotalComponent t : src.getTotal()) tgt.addTotal(convertTotalComponent(t));
093    if (src.hasPayment())
094      tgt.setPayment(convertPaymentComponent(src.getPayment()));
095    if (src.hasFundsReserve())
096      tgt.setFundsReserve(CodeableConcept43_50.convertCodeableConcept(src.getFundsReserve()));
097    if (src.hasFormCode())
098      tgt.setFormCode(CodeableConcept43_50.convertCodeableConcept(src.getFormCode()));
099    if (src.hasForm())
100      tgt.setForm(Attachment43_50.convertAttachment(src.getForm()));
101    for (org.hl7.fhir.r4b.model.ClaimResponse.NoteComponent t : src.getProcessNote())
102      tgt.addProcessNote(convertNoteComponent(t));
103    for (org.hl7.fhir.r4b.model.Reference t : src.getCommunicationRequest())
104      tgt.addCommunicationRequest(Reference43_50.convertReference(t));
105    for (org.hl7.fhir.r4b.model.ClaimResponse.InsuranceComponent t : src.getInsurance())
106      tgt.addInsurance(convertInsuranceComponent(t));
107    for (org.hl7.fhir.r4b.model.ClaimResponse.ErrorComponent t : src.getError()) tgt.addError(convertErrorComponent(t));
108    return tgt;
109  }
110
111  public static org.hl7.fhir.r4b.model.ClaimResponse convertClaimResponse(org.hl7.fhir.r5.model.ClaimResponse src) throws FHIRException {
112    if (src == null)
113      return null;
114    org.hl7.fhir.r4b.model.ClaimResponse tgt = new org.hl7.fhir.r4b.model.ClaimResponse();
115    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyDomainResource(src, tgt);
116    for (org.hl7.fhir.r5.model.Identifier t : src.getIdentifier())
117      tgt.addIdentifier(Identifier43_50.convertIdentifier(t));
118    if (src.hasStatus())
119      tgt.setStatusElement(convertClaimResponseStatus(src.getStatusElement()));
120    if (src.hasType())
121      tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
122    if (src.hasSubType())
123      tgt.setSubType(CodeableConcept43_50.convertCodeableConcept(src.getSubType()));
124    if (src.hasUse())
125      tgt.setUseElement(convertUse(src.getUseElement()));
126    if (src.hasPatient())
127      tgt.setPatient(Reference43_50.convertReference(src.getPatient()));
128    if (src.hasCreated())
129      tgt.setCreatedElement(DateTime43_50.convertDateTime(src.getCreatedElement()));
130    if (src.hasInsurer())
131      tgt.setInsurer(Reference43_50.convertReference(src.getInsurer()));
132    if (src.hasRequestor())
133      tgt.setRequestor(Reference43_50.convertReference(src.getRequestor()));
134    if (src.hasRequest())
135      tgt.setRequest(Reference43_50.convertReference(src.getRequest()));
136    if (src.hasOutcome())
137      tgt.setOutcomeElement(convertRemittanceOutcome(src.getOutcomeElement()));
138    if (src.hasDisposition())
139      tgt.setDispositionElement(String43_50.convertString(src.getDispositionElement()));
140    if (src.hasPreAuthRef())
141      tgt.setPreAuthRefElement(String43_50.convertString(src.getPreAuthRefElement()));
142    if (src.hasPreAuthPeriod())
143      tgt.setPreAuthPeriod(Period43_50.convertPeriod(src.getPreAuthPeriod()));
144    if (src.hasPayeeType())
145      tgt.setPayeeType(CodeableConcept43_50.convertCodeableConcept(src.getPayeeType()));
146    for (org.hl7.fhir.r5.model.ClaimResponse.ItemComponent t : src.getItem()) tgt.addItem(convertItemComponent(t));
147    for (org.hl7.fhir.r5.model.ClaimResponse.AddedItemComponent t : src.getAddItem())
148      tgt.addAddItem(convertAddedItemComponent(t));
149    for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
150      tgt.addAdjudication(convertAdjudicationComponent(t));
151    for (org.hl7.fhir.r5.model.ClaimResponse.TotalComponent t : src.getTotal()) tgt.addTotal(convertTotalComponent(t));
152    if (src.hasPayment())
153      tgt.setPayment(convertPaymentComponent(src.getPayment()));
154    if (src.hasFundsReserve())
155      tgt.setFundsReserve(CodeableConcept43_50.convertCodeableConcept(src.getFundsReserve()));
156    if (src.hasFormCode())
157      tgt.setFormCode(CodeableConcept43_50.convertCodeableConcept(src.getFormCode()));
158    if (src.hasForm())
159      tgt.setForm(Attachment43_50.convertAttachment(src.getForm()));
160    for (org.hl7.fhir.r5.model.ClaimResponse.NoteComponent t : src.getProcessNote())
161      tgt.addProcessNote(convertNoteComponent(t));
162    for (org.hl7.fhir.r5.model.Reference t : src.getCommunicationRequest())
163      tgt.addCommunicationRequest(Reference43_50.convertReference(t));
164    for (org.hl7.fhir.r5.model.ClaimResponse.InsuranceComponent t : src.getInsurance())
165      tgt.addInsurance(convertInsuranceComponent(t));
166    for (org.hl7.fhir.r5.model.ClaimResponse.ErrorComponent t : src.getError()) tgt.addError(convertErrorComponent(t));
167    return tgt;
168  }
169
170  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes> convertClaimResponseStatus(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes> src) throws FHIRException {
171      if (src == null || src.isEmpty())
172          return null;
173      Enumeration<Enumerations.FinancialResourceStatusCodes> tgt = new Enumeration<>(new Enumerations.FinancialResourceStatusCodesEnumFactory());
174      ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
175      if (src.getValue() == null) {
176          tgt.setValue(null);
177      } else {
178          switch (src.getValue()) {
179              case ACTIVE:
180                  tgt.setValue(Enumerations.FinancialResourceStatusCodes.ACTIVE);
181                  break;
182              case CANCELLED:
183                  tgt.setValue(Enumerations.FinancialResourceStatusCodes.CANCELLED);
184                  break;
185              case DRAFT:
186                  tgt.setValue(Enumerations.FinancialResourceStatusCodes.DRAFT);
187                  break;
188              case ENTEREDINERROR:
189                  tgt.setValue(Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR);
190                  break;
191              default:
192                  tgt.setValue(Enumerations.FinancialResourceStatusCodes.NULL);
193                  break;
194          }
195      }
196      return tgt;
197  }
198
199  static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes> convertClaimResponseStatus(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.FinancialResourceStatusCodes> src) throws FHIRException {
200      if (src == null || src.isEmpty())
201          return null;
202      org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodesEnumFactory());
203      ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
204      if (src.getValue() == null) {
205          tgt.setValue(null);
206      } else {
207          switch (src.getValue()) {
208              case ACTIVE:
209                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ACTIVE);
210                  break;
211              case CANCELLED:
212                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.CANCELLED);
213                  break;
214              case DRAFT:
215                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.DRAFT);
216                  break;
217              case ENTEREDINERROR:
218                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.ENTEREDINERROR);
219                  break;
220              default:
221                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.FinancialResourceStatusCodes.NULL);
222                  break;
223          }
224      }
225      return tgt;
226  }
227
228  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.Use> convertUse(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.Use> src) throws FHIRException {
229      if (src == null || src.isEmpty())
230          return null;
231      Enumeration<Enumerations.Use> tgt = new Enumeration<>(new Enumerations.UseEnumFactory());
232      ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
233      if (src.getValue() == null) {
234          tgt.setValue(null);
235      } else {
236          switch (src.getValue()) {
237              case CLAIM:
238                  tgt.setValue(Enumerations.Use.CLAIM);
239                  break;
240              case PREAUTHORIZATION:
241                  tgt.setValue(Enumerations.Use.PREAUTHORIZATION);
242                  break;
243              case PREDETERMINATION:
244                  tgt.setValue(Enumerations.Use.PREDETERMINATION);
245                  break;
246              default:
247                  tgt.setValue(Enumerations.Use.NULL);
248                  break;
249          }
250      }
251      return tgt;
252  }
253
254  static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.Use> convertUse(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.Use> src) throws FHIRException {
255      if (src == null || src.isEmpty())
256          return null;
257      org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.Use> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.UseEnumFactory());
258      ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
259      if (src.getValue() == null) {
260          tgt.setValue(null);
261      } else {
262          switch (src.getValue()) {
263              case CLAIM:
264                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.CLAIM);
265                  break;
266              case PREAUTHORIZATION:
267                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.PREAUTHORIZATION);
268                  break;
269              case PREDETERMINATION:
270                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.PREDETERMINATION);
271                  break;
272              default:
273                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.Use.NULL);
274                  break;
275          }
276      }
277      return tgt;
278  }
279
280  static public org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes> convertRemittanceOutcome(org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome> src) throws FHIRException {
281      if (src == null || src.isEmpty())
282          return null;
283      Enumeration<Enumerations.ClaimProcessingCodes> tgt = new Enumeration<>(new Enumerations.ClaimProcessingCodesEnumFactory());
284      ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
285      if (src.getValue() == null) {
286          tgt.setValue(null);
287      } else {
288          switch (src.getValue()) {
289              case QUEUED:
290                  tgt.setValue(Enumerations.ClaimProcessingCodes.QUEUED);
291                  break;
292              case COMPLETE:
293                  tgt.setValue(Enumerations.ClaimProcessingCodes.COMPLETE);
294                  break;
295              case ERROR:
296                  tgt.setValue(Enumerations.ClaimProcessingCodes.ERROR);
297                  break;
298              case PARTIAL:
299                  tgt.setValue(Enumerations.ClaimProcessingCodes.PARTIAL);
300                  break;
301              default:
302                  tgt.setValue(Enumerations.ClaimProcessingCodes.NULL);
303                  break;
304          }
305      }
306      return tgt;
307  }
308
309  static public org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome> convertRemittanceOutcome(org.hl7.fhir.r5.model.Enumeration<org.hl7.fhir.r5.model.Enumerations.ClaimProcessingCodes> src) throws FHIRException {
310      if (src == null || src.isEmpty())
311          return null;
312      org.hl7.fhir.r4b.model.Enumeration<org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome> tgt = new org.hl7.fhir.r4b.model.Enumeration<>(new org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcomeEnumFactory());
313      ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyElement(src, tgt);
314      if (src.getValue() == null) {
315          tgt.setValue(null);
316      } else {
317          switch (src.getValue()) {
318              case QUEUED:
319                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome.QUEUED);
320                  break;
321              case COMPLETE:
322                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome.COMPLETE);
323                  break;
324              case ERROR:
325                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome.ERROR);
326                  break;
327              case PARTIAL:
328                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome.PARTIAL);
329                  break;
330              default:
331                  tgt.setValue(org.hl7.fhir.r4b.model.Enumerations.RemittanceOutcome.NULL);
332                  break;
333          }
334      }
335      return tgt;
336  }
337
338  public static org.hl7.fhir.r5.model.ClaimResponse.ItemComponent convertItemComponent(org.hl7.fhir.r4b.model.ClaimResponse.ItemComponent src) throws FHIRException {
339    if (src == null)
340      return null;
341    org.hl7.fhir.r5.model.ClaimResponse.ItemComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.ItemComponent();
342    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
343    if (src.hasItemSequence())
344      tgt.setItemSequenceElement(PositiveInt43_50.convertPositiveInt(src.getItemSequenceElement()));
345    for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getNoteNumber())
346      tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t));
347    for (org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
348      tgt.addAdjudication(convertAdjudicationComponent(t));
349    for (org.hl7.fhir.r4b.model.ClaimResponse.ItemDetailComponent t : src.getDetail())
350      tgt.addDetail(convertItemDetailComponent(t));
351    return tgt;
352  }
353
354  public static org.hl7.fhir.r4b.model.ClaimResponse.ItemComponent convertItemComponent(org.hl7.fhir.r5.model.ClaimResponse.ItemComponent src) throws FHIRException {
355    if (src == null)
356      return null;
357    org.hl7.fhir.r4b.model.ClaimResponse.ItemComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.ItemComponent();
358    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
359    if (src.hasItemSequence())
360      tgt.setItemSequenceElement(PositiveInt43_50.convertPositiveInt(src.getItemSequenceElement()));
361    for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber())
362      tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t));
363    for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
364      tgt.addAdjudication(convertAdjudicationComponent(t));
365    for (org.hl7.fhir.r5.model.ClaimResponse.ItemDetailComponent t : src.getDetail())
366      tgt.addDetail(convertItemDetailComponent(t));
367    return tgt;
368  }
369
370  public static org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent convertAdjudicationComponent(org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent src) throws FHIRException {
371    if (src == null)
372      return null;
373    org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent();
374    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
375    if (src.hasCategory())
376      tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory()));
377    if (src.hasReason())
378      tgt.setReason(CodeableConcept43_50.convertCodeableConcept(src.getReason()));
379    if (src.hasAmount())
380      tgt.setAmount(Money43_50.convertMoney(src.getAmount()));
381    if (src.hasValue())
382      tgt.setQuantity(Decimal43_50.convertDecimalToQuantity(src.getValueElement()));
383    return tgt;
384  }
385
386  public static org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent convertAdjudicationComponent(org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent src) throws FHIRException {
387    if (src == null)
388      return null;
389    org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent();
390    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
391    if (src.hasCategory())
392      tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory()));
393    if (src.hasReason())
394      tgt.setReason(CodeableConcept43_50.convertCodeableConcept(src.getReason()));
395    if (src.hasAmount())
396      tgt.setAmount(Money43_50.convertMoney(src.getAmount()));
397    if (src.hasQuantity())
398      tgt.setValueElement(Decimal43_50.convertDecimal(src.getQuantity().getValueElement()));
399    return tgt;
400  }
401
402  public static org.hl7.fhir.r5.model.ClaimResponse.ItemDetailComponent convertItemDetailComponent(org.hl7.fhir.r4b.model.ClaimResponse.ItemDetailComponent src) throws FHIRException {
403    if (src == null)
404      return null;
405    org.hl7.fhir.r5.model.ClaimResponse.ItemDetailComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.ItemDetailComponent();
406    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
407    if (src.hasDetailSequence())
408      tgt.setDetailSequenceElement(PositiveInt43_50.convertPositiveInt(src.getDetailSequenceElement()));
409    for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getNoteNumber())
410      tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t));
411    for (org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
412      tgt.addAdjudication(convertAdjudicationComponent(t));
413    for (org.hl7.fhir.r4b.model.ClaimResponse.SubDetailComponent t : src.getSubDetail())
414      tgt.addSubDetail(convertSubDetailComponent(t));
415    return tgt;
416  }
417
418  public static org.hl7.fhir.r4b.model.ClaimResponse.ItemDetailComponent convertItemDetailComponent(org.hl7.fhir.r5.model.ClaimResponse.ItemDetailComponent src) throws FHIRException {
419    if (src == null)
420      return null;
421    org.hl7.fhir.r4b.model.ClaimResponse.ItemDetailComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.ItemDetailComponent();
422    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
423    if (src.hasDetailSequence())
424      tgt.setDetailSequenceElement(PositiveInt43_50.convertPositiveInt(src.getDetailSequenceElement()));
425    for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber())
426      tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t));
427    for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
428      tgt.addAdjudication(convertAdjudicationComponent(t));
429    for (org.hl7.fhir.r5.model.ClaimResponse.SubDetailComponent t : src.getSubDetail())
430      tgt.addSubDetail(convertSubDetailComponent(t));
431    return tgt;
432  }
433
434  public static org.hl7.fhir.r5.model.ClaimResponse.SubDetailComponent convertSubDetailComponent(org.hl7.fhir.r4b.model.ClaimResponse.SubDetailComponent src) throws FHIRException {
435    if (src == null)
436      return null;
437    org.hl7.fhir.r5.model.ClaimResponse.SubDetailComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.SubDetailComponent();
438    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
439    if (src.hasSubDetailSequence())
440      tgt.setSubDetailSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSubDetailSequenceElement()));
441    for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getNoteNumber())
442      tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t));
443    for (org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
444      tgt.addAdjudication(convertAdjudicationComponent(t));
445    return tgt;
446  }
447
448  public static org.hl7.fhir.r4b.model.ClaimResponse.SubDetailComponent convertSubDetailComponent(org.hl7.fhir.r5.model.ClaimResponse.SubDetailComponent src) throws FHIRException {
449    if (src == null)
450      return null;
451    org.hl7.fhir.r4b.model.ClaimResponse.SubDetailComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.SubDetailComponent();
452    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
453    if (src.hasSubDetailSequence())
454      tgt.setSubDetailSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSubDetailSequenceElement()));
455    for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber())
456      tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t));
457    for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
458      tgt.addAdjudication(convertAdjudicationComponent(t));
459    return tgt;
460  }
461
462  public static org.hl7.fhir.r5.model.ClaimResponse.AddedItemComponent convertAddedItemComponent(org.hl7.fhir.r4b.model.ClaimResponse.AddedItemComponent src) throws FHIRException {
463    if (src == null)
464      return null;
465    org.hl7.fhir.r5.model.ClaimResponse.AddedItemComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.AddedItemComponent();
466    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
467    for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getItemSequence())
468      tgt.getItemSequence().add(PositiveInt43_50.convertPositiveInt(t));
469    for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getDetailSequence())
470      tgt.getDetailSequence().add(PositiveInt43_50.convertPositiveInt(t));
471    for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getSubdetailSequence())
472      tgt.getSubdetailSequence().add(PositiveInt43_50.convertPositiveInt(t));
473    for (org.hl7.fhir.r4b.model.Reference t : src.getProvider()) tgt.addProvider(Reference43_50.convertReference(t));
474    if (src.hasProductOrService())
475      tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService()));
476    for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getModifier())
477      tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t));
478    for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getProgramCode())
479      tgt.addProgramCode(CodeableConcept43_50.convertCodeableConcept(t));
480    if (src.hasServiced())
481      tgt.setServiced(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getServiced()));
482    if (src.hasLocation())
483      tgt.setLocation(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getLocation()));
484    if (src.hasQuantity())
485      tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity()));
486    if (src.hasUnitPrice())
487      tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice()));
488    if (src.hasFactor())
489      tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement()));
490    if (src.hasNet())
491      tgt.setNet(Money43_50.convertMoney(src.getNet()));
492    if (src.hasBodySite())
493      tgt.getBodySiteFirstRep().addSite(CodeableConcept43_50.convertCodeableConceptToCodeableReference(src.getBodySite()));
494    for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getSubSite())
495      tgt.getBodySiteFirstRep().addSubSite(CodeableConcept43_50.convertCodeableConcept(t));
496    for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getNoteNumber())
497      tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t));
498    for (org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
499      tgt.addAdjudication(convertAdjudicationComponent(t));
500    for (org.hl7.fhir.r4b.model.ClaimResponse.AddedItemDetailComponent t : src.getDetail())
501      tgt.addDetail(convertAddedItemDetailComponent(t));
502    return tgt;
503  }
504
505  public static org.hl7.fhir.r4b.model.ClaimResponse.AddedItemComponent convertAddedItemComponent(org.hl7.fhir.r5.model.ClaimResponse.AddedItemComponent src) throws FHIRException {
506    if (src == null)
507      return null;
508    org.hl7.fhir.r4b.model.ClaimResponse.AddedItemComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.AddedItemComponent();
509    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
510    for (org.hl7.fhir.r5.model.PositiveIntType t : src.getItemSequence())
511      tgt.getItemSequence().add(PositiveInt43_50.convertPositiveInt(t));
512    for (org.hl7.fhir.r5.model.PositiveIntType t : src.getDetailSequence())
513      tgt.getDetailSequence().add(PositiveInt43_50.convertPositiveInt(t));
514    for (org.hl7.fhir.r5.model.PositiveIntType t : src.getSubdetailSequence())
515      tgt.getSubdetailSequence().add(PositiveInt43_50.convertPositiveInt(t));
516    for (org.hl7.fhir.r5.model.Reference t : src.getProvider()) tgt.addProvider(Reference43_50.convertReference(t));
517    if (src.hasProductOrService())
518      tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService()));
519    for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier())
520      tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t));
521    for (org.hl7.fhir.r5.model.CodeableConcept t : src.getProgramCode())
522      tgt.addProgramCode(CodeableConcept43_50.convertCodeableConcept(t));
523    if (src.hasServiced())
524      tgt.setServiced(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getServiced()));
525    if (src.hasLocation())
526      tgt.setLocation(ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().convertType(src.getLocation()));
527    if (src.hasQuantity())
528      tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity()));
529    if (src.hasUnitPrice())
530      tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice()));
531    if (src.hasFactor())
532      tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement()));
533    if (src.hasNet())
534      tgt.setNet(Money43_50.convertMoney(src.getNet()));
535    if (src.getBodySiteFirstRep().hasSite())
536      tgt.setBodySite(CodeableConcept43_50.convertCodeableReferenceToCodeableConcept(src.getBodySiteFirstRep().getSiteFirstRep()));
537    for (org.hl7.fhir.r5.model.CodeableConcept t : src.getBodySiteFirstRep().getSubSite())
538      tgt.addSubSite(CodeableConcept43_50.convertCodeableConcept(t));
539    for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber())
540      tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t));
541    for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
542      tgt.addAdjudication(convertAdjudicationComponent(t));
543    for (org.hl7.fhir.r5.model.ClaimResponse.AddedItemDetailComponent t : src.getDetail())
544      tgt.addDetail(convertAddedItemDetailComponent(t));
545    return tgt;
546  }
547
548  public static org.hl7.fhir.r5.model.ClaimResponse.AddedItemDetailComponent convertAddedItemDetailComponent(org.hl7.fhir.r4b.model.ClaimResponse.AddedItemDetailComponent src) throws FHIRException {
549    if (src == null)
550      return null;
551    org.hl7.fhir.r5.model.ClaimResponse.AddedItemDetailComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.AddedItemDetailComponent();
552    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
553    if (src.hasProductOrService())
554      tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService()));
555    for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getModifier())
556      tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t));
557    if (src.hasQuantity())
558      tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity()));
559    if (src.hasUnitPrice())
560      tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice()));
561    if (src.hasFactor())
562      tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement()));
563    if (src.hasNet())
564      tgt.setNet(Money43_50.convertMoney(src.getNet()));
565    for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getNoteNumber())
566      tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t));
567    for (org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
568      tgt.addAdjudication(convertAdjudicationComponent(t));
569    for (org.hl7.fhir.r4b.model.ClaimResponse.AddedItemSubDetailComponent t : src.getSubDetail())
570      tgt.addSubDetail(convertAddedItemSubDetailComponent(t));
571    return tgt;
572  }
573
574  public static org.hl7.fhir.r4b.model.ClaimResponse.AddedItemDetailComponent convertAddedItemDetailComponent(org.hl7.fhir.r5.model.ClaimResponse.AddedItemDetailComponent src) throws FHIRException {
575    if (src == null)
576      return null;
577    org.hl7.fhir.r4b.model.ClaimResponse.AddedItemDetailComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.AddedItemDetailComponent();
578    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
579    if (src.hasProductOrService())
580      tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService()));
581    for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier())
582      tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t));
583    if (src.hasQuantity())
584      tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity()));
585    if (src.hasUnitPrice())
586      tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice()));
587    if (src.hasFactor())
588      tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement()));
589    if (src.hasNet())
590      tgt.setNet(Money43_50.convertMoney(src.getNet()));
591    for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber())
592      tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t));
593    for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
594      tgt.addAdjudication(convertAdjudicationComponent(t));
595    for (org.hl7.fhir.r5.model.ClaimResponse.AddedItemSubDetailComponent t : src.getSubDetail())
596      tgt.addSubDetail(convertAddedItemSubDetailComponent(t));
597    return tgt;
598  }
599
600  public static org.hl7.fhir.r5.model.ClaimResponse.AddedItemSubDetailComponent convertAddedItemSubDetailComponent(org.hl7.fhir.r4b.model.ClaimResponse.AddedItemSubDetailComponent src) throws FHIRException {
601    if (src == null)
602      return null;
603    org.hl7.fhir.r5.model.ClaimResponse.AddedItemSubDetailComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.AddedItemSubDetailComponent();
604    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
605    if (src.hasProductOrService())
606      tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService()));
607    for (org.hl7.fhir.r4b.model.CodeableConcept t : src.getModifier())
608      tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t));
609    if (src.hasQuantity())
610      tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity()));
611    if (src.hasUnitPrice())
612      tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice()));
613    if (src.hasFactor())
614      tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement()));
615    if (src.hasNet())
616      tgt.setNet(Money43_50.convertMoney(src.getNet()));
617    for (org.hl7.fhir.r4b.model.PositiveIntType t : src.getNoteNumber())
618      tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t));
619    for (org.hl7.fhir.r4b.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
620      tgt.addAdjudication(convertAdjudicationComponent(t));
621    return tgt;
622  }
623
624  public static org.hl7.fhir.r4b.model.ClaimResponse.AddedItemSubDetailComponent convertAddedItemSubDetailComponent(org.hl7.fhir.r5.model.ClaimResponse.AddedItemSubDetailComponent src) throws FHIRException {
625    if (src == null)
626      return null;
627    org.hl7.fhir.r4b.model.ClaimResponse.AddedItemSubDetailComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.AddedItemSubDetailComponent();
628    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
629    if (src.hasProductOrService())
630      tgt.setProductOrService(CodeableConcept43_50.convertCodeableConcept(src.getProductOrService()));
631    for (org.hl7.fhir.r5.model.CodeableConcept t : src.getModifier())
632      tgt.addModifier(CodeableConcept43_50.convertCodeableConcept(t));
633    if (src.hasQuantity())
634      tgt.setQuantity(SimpleQuantity43_50.convertSimpleQuantity(src.getQuantity()));
635    if (src.hasUnitPrice())
636      tgt.setUnitPrice(Money43_50.convertMoney(src.getUnitPrice()));
637    if (src.hasFactor())
638      tgt.setFactorElement(Decimal43_50.convertDecimal(src.getFactorElement()));
639    if (src.hasNet())
640      tgt.setNet(Money43_50.convertMoney(src.getNet()));
641    for (org.hl7.fhir.r5.model.PositiveIntType t : src.getNoteNumber())
642      tgt.getNoteNumber().add(PositiveInt43_50.convertPositiveInt(t));
643    for (org.hl7.fhir.r5.model.ClaimResponse.AdjudicationComponent t : src.getAdjudication())
644      tgt.addAdjudication(convertAdjudicationComponent(t));
645    return tgt;
646  }
647
648  public static org.hl7.fhir.r5.model.ClaimResponse.TotalComponent convertTotalComponent(org.hl7.fhir.r4b.model.ClaimResponse.TotalComponent src) throws FHIRException {
649    if (src == null)
650      return null;
651    org.hl7.fhir.r5.model.ClaimResponse.TotalComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.TotalComponent();
652    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
653    if (src.hasCategory())
654      tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory()));
655    if (src.hasAmount())
656      tgt.setAmount(Money43_50.convertMoney(src.getAmount()));
657    return tgt;
658  }
659
660  public static org.hl7.fhir.r4b.model.ClaimResponse.TotalComponent convertTotalComponent(org.hl7.fhir.r5.model.ClaimResponse.TotalComponent src) throws FHIRException {
661    if (src == null)
662      return null;
663    org.hl7.fhir.r4b.model.ClaimResponse.TotalComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.TotalComponent();
664    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
665    if (src.hasCategory())
666      tgt.setCategory(CodeableConcept43_50.convertCodeableConcept(src.getCategory()));
667    if (src.hasAmount())
668      tgt.setAmount(Money43_50.convertMoney(src.getAmount()));
669    return tgt;
670  }
671
672  public static org.hl7.fhir.r5.model.ClaimResponse.PaymentComponent convertPaymentComponent(org.hl7.fhir.r4b.model.ClaimResponse.PaymentComponent src) throws FHIRException {
673    if (src == null)
674      return null;
675    org.hl7.fhir.r5.model.ClaimResponse.PaymentComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.PaymentComponent();
676    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
677    if (src.hasType())
678      tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
679    if (src.hasAdjustment())
680      tgt.setAdjustment(Money43_50.convertMoney(src.getAdjustment()));
681    if (src.hasAdjustmentReason())
682      tgt.setAdjustmentReason(CodeableConcept43_50.convertCodeableConcept(src.getAdjustmentReason()));
683    if (src.hasDate())
684      tgt.setDateElement(Date43_50.convertDate(src.getDateElement()));
685    if (src.hasAmount())
686      tgt.setAmount(Money43_50.convertMoney(src.getAmount()));
687    if (src.hasIdentifier())
688      tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier()));
689    return tgt;
690  }
691
692  public static org.hl7.fhir.r4b.model.ClaimResponse.PaymentComponent convertPaymentComponent(org.hl7.fhir.r5.model.ClaimResponse.PaymentComponent src) throws FHIRException {
693    if (src == null)
694      return null;
695    org.hl7.fhir.r4b.model.ClaimResponse.PaymentComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.PaymentComponent();
696    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
697    if (src.hasType())
698      tgt.setType(CodeableConcept43_50.convertCodeableConcept(src.getType()));
699    if (src.hasAdjustment())
700      tgt.setAdjustment(Money43_50.convertMoney(src.getAdjustment()));
701    if (src.hasAdjustmentReason())
702      tgt.setAdjustmentReason(CodeableConcept43_50.convertCodeableConcept(src.getAdjustmentReason()));
703    if (src.hasDate())
704      tgt.setDateElement(Date43_50.convertDate(src.getDateElement()));
705    if (src.hasAmount())
706      tgt.setAmount(Money43_50.convertMoney(src.getAmount()));
707    if (src.hasIdentifier())
708      tgt.setIdentifier(Identifier43_50.convertIdentifier(src.getIdentifier()));
709    return tgt;
710  }
711
712  public static org.hl7.fhir.r5.model.ClaimResponse.NoteComponent convertNoteComponent(org.hl7.fhir.r4b.model.ClaimResponse.NoteComponent src) throws FHIRException {
713    if (src == null)
714      return null;
715    org.hl7.fhir.r5.model.ClaimResponse.NoteComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.NoteComponent();
716    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
717    if (src.hasNumber())
718      tgt.setNumberElement(PositiveInt43_50.convertPositiveInt(src.getNumberElement()));
719    if (src.hasType())
720      tgt.getType().addCoding().setSystem("http://hl7.org/fhir/note-type").setCode(src.getType().toCode());
721    if (src.hasText())
722      tgt.setTextElement(String43_50.convertString(src.getTextElement()));
723    if (src.hasLanguage())
724      tgt.setLanguage(CodeableConcept43_50.convertCodeableConcept(src.getLanguage()));
725    return tgt;
726  }
727
728  public static org.hl7.fhir.r4b.model.ClaimResponse.NoteComponent convertNoteComponent(org.hl7.fhir.r5.model.ClaimResponse.NoteComponent src) throws FHIRException {
729    if (src == null)
730      return null;
731    org.hl7.fhir.r4b.model.ClaimResponse.NoteComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.NoteComponent();
732    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
733    if (src.hasNumber())
734      tgt.setNumberElement(PositiveInt43_50.convertPositiveInt(src.getNumberElement()));
735    if (src.hasType() && src.getType().hasCoding("http://hl7.org/fhir/note-type"))
736      tgt.setType(org.hl7.fhir.r4b.model.Enumerations.NoteType.fromCode(src.getType().getCode("http://hl7.org/fhir/note-type")));
737    if (src.hasText())
738      tgt.setTextElement(String43_50.convertString(src.getTextElement()));
739    if (src.hasLanguage())
740      tgt.setLanguage(CodeableConcept43_50.convertCodeableConcept(src.getLanguage()));
741    return tgt;
742  }
743
744  public static org.hl7.fhir.r5.model.ClaimResponse.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r4b.model.ClaimResponse.InsuranceComponent src) throws FHIRException {
745    if (src == null)
746      return null;
747    org.hl7.fhir.r5.model.ClaimResponse.InsuranceComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.InsuranceComponent();
748    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
749    if (src.hasSequence())
750      tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement()));
751    if (src.hasFocal())
752      tgt.setFocalElement(Boolean43_50.convertBoolean(src.getFocalElement()));
753    if (src.hasCoverage())
754      tgt.setCoverage(Reference43_50.convertReference(src.getCoverage()));
755    if (src.hasBusinessArrangement())
756      tgt.setBusinessArrangementElement(String43_50.convertString(src.getBusinessArrangementElement()));
757    if (src.hasClaimResponse())
758      tgt.setClaimResponse(Reference43_50.convertReference(src.getClaimResponse()));
759    return tgt;
760  }
761
762  public static org.hl7.fhir.r4b.model.ClaimResponse.InsuranceComponent convertInsuranceComponent(org.hl7.fhir.r5.model.ClaimResponse.InsuranceComponent src) throws FHIRException {
763    if (src == null)
764      return null;
765    org.hl7.fhir.r4b.model.ClaimResponse.InsuranceComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.InsuranceComponent();
766    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
767    if (src.hasSequence())
768      tgt.setSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSequenceElement()));
769    if (src.hasFocal())
770      tgt.setFocalElement(Boolean43_50.convertBoolean(src.getFocalElement()));
771    if (src.hasCoverage())
772      tgt.setCoverage(Reference43_50.convertReference(src.getCoverage()));
773    if (src.hasBusinessArrangement())
774      tgt.setBusinessArrangementElement(String43_50.convertString(src.getBusinessArrangementElement()));
775    if (src.hasClaimResponse())
776      tgt.setClaimResponse(Reference43_50.convertReference(src.getClaimResponse()));
777    return tgt;
778  }
779
780  public static org.hl7.fhir.r5.model.ClaimResponse.ErrorComponent convertErrorComponent(org.hl7.fhir.r4b.model.ClaimResponse.ErrorComponent src) throws FHIRException {
781    if (src == null)
782      return null;
783    org.hl7.fhir.r5.model.ClaimResponse.ErrorComponent tgt = new org.hl7.fhir.r5.model.ClaimResponse.ErrorComponent();
784    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
785    if (src.hasItemSequence())
786      tgt.setItemSequenceElement(PositiveInt43_50.convertPositiveInt(src.getItemSequenceElement()));
787    if (src.hasDetailSequence())
788      tgt.setDetailSequenceElement(PositiveInt43_50.convertPositiveInt(src.getDetailSequenceElement()));
789    if (src.hasSubDetailSequence())
790      tgt.setSubDetailSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSubDetailSequenceElement()));
791    if (src.hasCode())
792      tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
793    return tgt;
794  }
795
796  public static org.hl7.fhir.r4b.model.ClaimResponse.ErrorComponent convertErrorComponent(org.hl7.fhir.r5.model.ClaimResponse.ErrorComponent src) throws FHIRException {
797    if (src == null)
798      return null;
799    org.hl7.fhir.r4b.model.ClaimResponse.ErrorComponent tgt = new org.hl7.fhir.r4b.model.ClaimResponse.ErrorComponent();
800    ConversionContext43_50.INSTANCE.getVersionConvertor_43_50().copyBackboneElement(src, tgt);
801    if (src.hasItemSequence())
802      tgt.setItemSequenceElement(PositiveInt43_50.convertPositiveInt(src.getItemSequenceElement()));
803    if (src.hasDetailSequence())
804      tgt.setDetailSequenceElement(PositiveInt43_50.convertPositiveInt(src.getDetailSequenceElement()));
805    if (src.hasSubDetailSequence())
806      tgt.setSubDetailSequenceElement(PositiveInt43_50.convertPositiveInt(src.getSubDetailSequenceElement()));
807    if (src.hasCode())
808      tgt.setCode(CodeableConcept43_50.convertCodeableConcept(src.getCode()));
809    return tgt;
810  }
811}