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