001package org.hl7.fhir.convertors.conv43_50.resources43_50;
002
003import java.util.Arrays;
004
005import org.hl7.fhir.convertors.advisors.impl.BaseAdvisor_43_50;
006import org.hl7.fhir.convertors.context.ConversionContext43_50;
007import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Code43_50;
008import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Id43_50;
009import org.hl7.fhir.convertors.conv43_50.datatypes43_50.primitive43_50.Uri43_50;
010import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Extension43_50;
011import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Meta43_50;
012import org.hl7.fhir.convertors.conv43_50.datatypes43_50.special43_50.Narrative43_50;
013import org.hl7.fhir.exceptions.FHIRException;
014
015public class Resource43_50 {
016
017  public final BaseAdvisor_43_50 advisor;
018
019  public Resource43_50(BaseAdvisor_43_50 advisor) {
020    this.advisor = advisor;
021  }
022
023  public void copyResource(org.hl7.fhir.r4b.model.Resource src, org.hl7.fhir.r5.model.Resource tgt) throws FHIRException {
024    if (src.hasId()) tgt.setIdElement(Id43_50.convertId(src.getIdElement()));
025    if (src.hasMeta()) tgt.setMeta(Meta43_50.convertMeta(src.getMeta()));
026    if (src.hasImplicitRules()) tgt.setImplicitRulesElement(Uri43_50.convertUri(src.getImplicitRulesElement()));
027    if (src.hasLanguage()) tgt.setLanguageElement(Code43_50.convertCode(src.getLanguageElement()));
028  }
029
030  public void copyResource(org.hl7.fhir.r5.model.Resource src, org.hl7.fhir.r4b.model.Resource tgt) throws FHIRException {
031    if (src.hasId()) tgt.setIdElement(Id43_50.convertId(src.getIdElement()));
032    if (src.hasMeta()) tgt.setMeta(Meta43_50.convertMeta(src.getMeta()));
033    if (src.hasImplicitRules()) tgt.setImplicitRulesElement(Uri43_50.convertUri(src.getImplicitRulesElement()));
034    if (src.hasLanguage()) tgt.setLanguageElement(Code43_50.convertCode(src.getLanguageElement()));
035  }
036
037  public org.hl7.fhir.r5.model.Resource convertResource(org.hl7.fhir.r4b.model.Resource src) throws FHIRException {
038    if (src == null) return null;
039    if (src instanceof org.hl7.fhir.r4b.model.Parameters)
040      return Parameters43_50.convertParameters((org.hl7.fhir.r4b.model.Parameters) src);
041    if (src instanceof org.hl7.fhir.r4b.model.Account)
042      return Account43_50.convertAccount((org.hl7.fhir.r4b.model.Account) src);
043    if (src instanceof org.hl7.fhir.r4b.model.ActivityDefinition)
044      return ActivityDefinition43_50.convertActivityDefinition((org.hl7.fhir.r4b.model.ActivityDefinition) src);
045    if (src instanceof org.hl7.fhir.r4b.model.AllergyIntolerance)
046      return AllergyIntolerance43_50.convertAllergyIntolerance((org.hl7.fhir.r4b.model.AllergyIntolerance) src);
047    if (src instanceof org.hl7.fhir.r4b.model.Appointment)
048      return Appointment43_50.convertAppointment((org.hl7.fhir.r4b.model.Appointment) src);
049    if (src instanceof org.hl7.fhir.r4b.model.AppointmentResponse)
050      return AppointmentResponse43_50.convertAppointmentResponse((org.hl7.fhir.r4b.model.AppointmentResponse) src);
051    if (src instanceof org.hl7.fhir.r4b.model.AuditEvent)
052      return AuditEvent43_50.convertAuditEvent((org.hl7.fhir.r4b.model.AuditEvent) src);
053    if (src instanceof org.hl7.fhir.r4b.model.Basic) {
054      org.hl7.fhir.r4b.model.Basic basic = (org.hl7.fhir.r4b.model.Basic) src;
055      if (basic.getCode().hasCoding("http://hl7.org/fhir/fhir-types", "ActorDefinition")) {
056        return ActorDefinition43_50.convertActorDefinition((org.hl7.fhir.r4b.model.Basic) src);
057      } else if (basic.getCode().hasCoding("http://hl7.org/fhir/fhir-types", "Requirements")) {
058        return Requirements43_50.convertRequirements((org.hl7.fhir.r4b.model.Basic) src);
059      } else if (basic.getCode().hasCoding("http://hl7.org/fhir/fhir-types", "TestPlan")) {
060        return TestPlan43_50.convertTestPlan((org.hl7.fhir.r4b.model.Basic) src);
061      } else {
062        return Basic43_50.convertBasic((org.hl7.fhir.r4b.model.Basic) src);
063      }
064    }
065    if (src instanceof org.hl7.fhir.r4b.model.Binary)
066      return Binary43_50.convertBinary((org.hl7.fhir.r4b.model.Binary) src);
067    if (src instanceof org.hl7.fhir.r4b.model.BiologicallyDerivedProduct)
068      return BiologicallyDerivedProduct43_50.convertBiologicallyDerivedProduct((org.hl7.fhir.r4b.model.BiologicallyDerivedProduct) src);
069    if (src instanceof org.hl7.fhir.r4b.model.BodyStructure)
070      return BodyStructure43_50.convertBodyStructure((org.hl7.fhir.r4b.model.BodyStructure) src);
071    if (src instanceof org.hl7.fhir.r4b.model.Bundle)
072      return Bundle43_50.convertBundle((org.hl7.fhir.r4b.model.Bundle) src);
073    if (src instanceof org.hl7.fhir.r4b.model.CapabilityStatement)
074      return CapabilityStatement43_50.convertCapabilityStatement((org.hl7.fhir.r4b.model.CapabilityStatement) src);
075    if (src instanceof org.hl7.fhir.r4b.model.CarePlan)
076      return CarePlan43_50.convertCarePlan((org.hl7.fhir.r4b.model.CarePlan) src);
077    if (src instanceof org.hl7.fhir.r4b.model.CareTeam)
078      return CareTeam43_50.convertCareTeam((org.hl7.fhir.r4b.model.CareTeam) src);
079    if (src instanceof org.hl7.fhir.r4b.model.ChargeItem)
080      return ChargeItem43_50.convertChargeItem((org.hl7.fhir.r4b.model.ChargeItem) src);
081    if (src instanceof org.hl7.fhir.r4b.model.ChargeItemDefinition)
082      return ChargeItemDefinition43_50.convertChargeItemDefinition((org.hl7.fhir.r4b.model.ChargeItemDefinition) src);
083    if (src instanceof org.hl7.fhir.r4b.model.Claim) return Claim43_50.convertClaim((org.hl7.fhir.r4b.model.Claim) src);
084    if (src instanceof org.hl7.fhir.r4b.model.ClaimResponse)
085      return ClaimResponse43_50.convertClaimResponse((org.hl7.fhir.r4b.model.ClaimResponse) src);
086    if (src instanceof org.hl7.fhir.r4b.model.ClinicalImpression)
087      return ClinicalImpression43_50.convertClinicalImpression((org.hl7.fhir.r4b.model.ClinicalImpression) src);
088    if (src instanceof org.hl7.fhir.r4b.model.CodeSystem)
089      return CodeSystem43_50.convertCodeSystem((org.hl7.fhir.r4b.model.CodeSystem) src);
090    if (src instanceof org.hl7.fhir.r4b.model.Communication)
091      return Communication43_50.convertCommunication((org.hl7.fhir.r4b.model.Communication) src);
092    if (src instanceof org.hl7.fhir.r4b.model.CommunicationRequest)
093      return CommunicationRequest43_50.convertCommunicationRequest((org.hl7.fhir.r4b.model.CommunicationRequest) src);
094    if (src instanceof org.hl7.fhir.r4b.model.CompartmentDefinition)
095      return CompartmentDefinition43_50.convertCompartmentDefinition((org.hl7.fhir.r4b.model.CompartmentDefinition) src);
096    if (src instanceof org.hl7.fhir.r4b.model.Composition)
097      return Composition43_50.convertComposition((org.hl7.fhir.r4b.model.Composition) src);
098    if (src instanceof org.hl7.fhir.r4b.model.ConceptMap)
099      return ConceptMap43_50.convertConceptMap((org.hl7.fhir.r4b.model.ConceptMap) src);
100    if (src instanceof org.hl7.fhir.r4b.model.Condition)
101      return Condition43_50.convertCondition((org.hl7.fhir.r4b.model.Condition) src);
102    if (src instanceof org.hl7.fhir.r4b.model.Consent)
103      return Consent43_50.convertConsent((org.hl7.fhir.r4b.model.Consent) src);
104    if (src instanceof org.hl7.fhir.r4b.model.Contract)
105      return Contract43_50.convertContract((org.hl7.fhir.r4b.model.Contract) src);
106    if (src instanceof org.hl7.fhir.r4b.model.Coverage)
107      return Coverage43_50.convertCoverage((org.hl7.fhir.r4b.model.Coverage) src);
108    if (src instanceof org.hl7.fhir.r4b.model.CoverageEligibilityRequest)
109      return CoverageEligibilityRequest43_50.convertCoverageEligibilityRequest((org.hl7.fhir.r4b.model.CoverageEligibilityRequest) src);
110    if (src instanceof org.hl7.fhir.r4b.model.DetectedIssue)
111      return DetectedIssue43_50.convertDetectedIssue((org.hl7.fhir.r4b.model.DetectedIssue) src);
112    if (src instanceof org.hl7.fhir.r4b.model.Device)
113      return Device43_50.convertDevice((org.hl7.fhir.r4b.model.Device) src);
114    if (src instanceof org.hl7.fhir.r4b.model.DeviceDefinition)
115      return DeviceDefinition43_50.convertDeviceDefinition((org.hl7.fhir.r4b.model.DeviceDefinition) src);
116    if (src instanceof org.hl7.fhir.r4b.model.DeviceMetric)
117      return DeviceMetric43_50.convertDeviceMetric((org.hl7.fhir.r4b.model.DeviceMetric) src);
118    if (src instanceof org.hl7.fhir.r4b.model.DeviceRequest)
119      return DeviceRequest43_50.convertDeviceRequest((org.hl7.fhir.r4b.model.DeviceRequest) src);
120    if (src instanceof org.hl7.fhir.r4b.model.DeviceUseStatement)
121      return DeviceUseStatement43_50.convertDeviceUseStatement((org.hl7.fhir.r4b.model.DeviceUseStatement) src);
122    if (src instanceof org.hl7.fhir.r4b.model.DiagnosticReport)
123      return DiagnosticReport43_50.convertDiagnosticReport((org.hl7.fhir.r4b.model.DiagnosticReport) src);
124//    if (src instanceof org.hl7.fhir.r4b.model.DocumentManifest)
125//      return DocumentManifest43_50.convertDocumentManifest((org.hl7.fhir.r4b.model.DocumentManifest) src);
126    if (src instanceof org.hl7.fhir.r4b.model.DocumentReference)
127      return DocumentReference43_50.convertDocumentReference((org.hl7.fhir.r4b.model.DocumentReference) src);
128    if (src instanceof org.hl7.fhir.r4b.model.Encounter)
129      return Encounter43_50.convertEncounter((org.hl7.fhir.r4b.model.Encounter) src);
130    if (src instanceof org.hl7.fhir.r4b.model.Endpoint)
131      return Endpoint43_50.convertEndpoint((org.hl7.fhir.r4b.model.Endpoint) src);
132    if (src instanceof org.hl7.fhir.r4b.model.EnrollmentRequest)
133      return EnrollmentRequest43_50.convertEnrollmentRequest((org.hl7.fhir.r4b.model.EnrollmentRequest) src);
134    if (src instanceof org.hl7.fhir.r4b.model.EpisodeOfCare)
135      return EpisodeOfCare43_50.convertEpisodeOfCare((org.hl7.fhir.r4b.model.EpisodeOfCare) src);
136    if (src instanceof org.hl7.fhir.r4b.model.EventDefinition)
137      return EventDefinition43_50.convertEventDefinition((org.hl7.fhir.r4b.model.EventDefinition) src);
138    if (src instanceof org.hl7.fhir.r4b.model.ExampleScenario)
139      return ExampleScenario43_50.convertExampleScenario((org.hl7.fhir.r4b.model.ExampleScenario) src);
140    if (src instanceof org.hl7.fhir.r4b.model.ExplanationOfBenefit)
141      return ExplanationOfBenefit43_50.convertExplanationOfBenefit((org.hl7.fhir.r4b.model.ExplanationOfBenefit) src);
142    if (src instanceof org.hl7.fhir.r4b.model.FamilyMemberHistory)
143      return FamilyMemberHistory43_50.convertFamilyMemberHistory((org.hl7.fhir.r4b.model.FamilyMemberHistory) src);
144    if (src instanceof org.hl7.fhir.r4b.model.Flag) return Flag43_50.convertFlag((org.hl7.fhir.r4b.model.Flag) src);
145    if (src instanceof org.hl7.fhir.r4b.model.Goal) return Goal43_50.convertGoal((org.hl7.fhir.r4b.model.Goal) src);
146    if (src instanceof org.hl7.fhir.r4b.model.GraphDefinition)
147      return GraphDefinition43_50.convertGraphDefinition((org.hl7.fhir.r4b.model.GraphDefinition) src);
148    if (src instanceof org.hl7.fhir.r4b.model.Group) return Group43_50.convertGroup((org.hl7.fhir.r4b.model.Group) src);
149    if (src instanceof org.hl7.fhir.r4b.model.GuidanceResponse)
150      return GuidanceResponse43_50.convertGuidanceResponse((org.hl7.fhir.r4b.model.GuidanceResponse) src);
151    if (src instanceof org.hl7.fhir.r4b.model.HealthcareService)
152      return HealthcareService43_50.convertHealthcareService((org.hl7.fhir.r4b.model.HealthcareService) src);
153    if (src instanceof org.hl7.fhir.r4b.model.ImagingStudy)
154      return ImagingStudy43_50.convertImagingStudy((org.hl7.fhir.r4b.model.ImagingStudy) src);
155    if (src instanceof org.hl7.fhir.r4b.model.Immunization)
156      return Immunization43_50.convertImmunization((org.hl7.fhir.r4b.model.Immunization) src);
157    if (src instanceof org.hl7.fhir.r4b.model.ImmunizationEvaluation)
158      return ImmunizationEvaluation43_50.convertImmunizationEvaluation((org.hl7.fhir.r4b.model.ImmunizationEvaluation) src);
159    if (src instanceof org.hl7.fhir.r4b.model.ImmunizationRecommendation)
160      return ImmunizationRecommendation43_50.convertImmunizationRecommendation((org.hl7.fhir.r4b.model.ImmunizationRecommendation) src);
161    if (src instanceof org.hl7.fhir.r4b.model.ImplementationGuide)
162      return ImplementationGuide43_50.convertImplementationGuide((org.hl7.fhir.r4b.model.ImplementationGuide) src);
163    if (src instanceof org.hl7.fhir.r4b.model.InsurancePlan)
164      return InsurancePlan43_50.convertInsurancePlan((org.hl7.fhir.r4b.model.InsurancePlan) src);
165    if (src instanceof org.hl7.fhir.r4b.model.Invoice)
166      return Invoice43_50.convertInvoice((org.hl7.fhir.r4b.model.Invoice) src);
167    if (src instanceof org.hl7.fhir.r4b.model.Library)
168      return Library43_50.convertLibrary((org.hl7.fhir.r4b.model.Library) src);
169    if (src instanceof org.hl7.fhir.r4b.model.Linkage)
170      return Linkage43_50.convertLinkage((org.hl7.fhir.r4b.model.Linkage) src);
171    if (src instanceof org.hl7.fhir.r4b.model.ListResource)
172      return ListResource43_50.convertListResource((org.hl7.fhir.r4b.model.ListResource) src);
173    if (src instanceof org.hl7.fhir.r4b.model.Location)
174      return Location43_50.convertLocation((org.hl7.fhir.r4b.model.Location) src);
175    if (src instanceof org.hl7.fhir.r4b.model.Measure)
176      return Measure43_50.convertMeasure((org.hl7.fhir.r4b.model.Measure) src);
177    if (src instanceof org.hl7.fhir.r4b.model.MeasureReport)
178      return MeasureReport43_50.convertMeasureReport((org.hl7.fhir.r4b.model.MeasureReport) src);
179    if (src instanceof org.hl7.fhir.r4b.model.Media) return Media43_50.convertMedia((org.hl7.fhir.r4b.model.Media) src);
180    if (src instanceof org.hl7.fhir.r4b.model.Medication)
181      return Medication43_50.convertMedication((org.hl7.fhir.r4b.model.Medication) src);
182    if (src instanceof org.hl7.fhir.r4b.model.MedicationAdministration)
183      return MedicationAdministration43_50.convertMedicationAdministration((org.hl7.fhir.r4b.model.MedicationAdministration) src);
184    if (src instanceof org.hl7.fhir.r4b.model.MedicationDispense)
185      return MedicationDispense43_50.convertMedicationDispense((org.hl7.fhir.r4b.model.MedicationDispense) src);
186    if (src instanceof org.hl7.fhir.r4b.model.MedicationKnowledge)
187      return MedicationKnowledge43_50.convertMedicationKnowledge((org.hl7.fhir.r4b.model.MedicationKnowledge) src);
188    if (src instanceof org.hl7.fhir.r4b.model.MedicationRequest)
189      return MedicationRequest43_50.convertMedicationRequest((org.hl7.fhir.r4b.model.MedicationRequest) src);
190    if (src instanceof org.hl7.fhir.r4b.model.MedicationStatement)
191      return MedicationStatement43_50.convertMedicationStatement((org.hl7.fhir.r4b.model.MedicationStatement) src);
192    if (src instanceof org.hl7.fhir.r4b.model.MessageDefinition)
193      return MessageDefinition43_50.convertMessageDefinition((org.hl7.fhir.r4b.model.MessageDefinition) src);
194    if (src instanceof org.hl7.fhir.r4b.model.MessageHeader)
195      return MessageHeader43_50.convertMessageHeader((org.hl7.fhir.r4b.model.MessageHeader) src);
196    if (src instanceof org.hl7.fhir.r4b.model.NamingSystem)
197      return NamingSystem43_50.convertNamingSystem((org.hl7.fhir.r4b.model.NamingSystem) src);
198    if (src instanceof org.hl7.fhir.r4b.model.NutritionOrder)
199      return NutritionOrder43_50.convertNutritionOrder((org.hl7.fhir.r4b.model.NutritionOrder) src);
200    if (src instanceof org.hl7.fhir.r4b.model.Observation)
201      return Observation43_50.convertObservation((org.hl7.fhir.r4b.model.Observation) src);
202    if (src instanceof org.hl7.fhir.r4b.model.ObservationDefinition)
203      return ObservationDefinition43_50.convertObservationDefinition((org.hl7.fhir.r4b.model.ObservationDefinition) src);
204    if (src instanceof org.hl7.fhir.r4b.model.OperationDefinition)
205      return OperationDefinition43_50.convertOperationDefinition((org.hl7.fhir.r4b.model.OperationDefinition) src);
206    if (src instanceof org.hl7.fhir.r4b.model.OperationOutcome)
207      return OperationOutcome43_50.convertOperationOutcome((org.hl7.fhir.r4b.model.OperationOutcome) src);
208    if (src instanceof org.hl7.fhir.r4b.model.Organization)
209      return Organization43_50.convertOrganization((org.hl7.fhir.r4b.model.Organization) src);
210    if (src instanceof org.hl7.fhir.r4b.model.OrganizationAffiliation)
211      return OrganizationAffiliation43_50.convertOrganizationAffiliation((org.hl7.fhir.r4b.model.OrganizationAffiliation) src);
212    if (src instanceof org.hl7.fhir.r4b.model.Patient)
213      return Patient43_50.convertPatient((org.hl7.fhir.r4b.model.Patient) src);
214    if (src instanceof org.hl7.fhir.r4b.model.PaymentNotice)
215      return PaymentNotice43_50.convertPaymentNotice((org.hl7.fhir.r4b.model.PaymentNotice) src);
216    if (src instanceof org.hl7.fhir.r4b.model.Person)
217      return Person43_50.convertPerson((org.hl7.fhir.r4b.model.Person) src);
218    if (src instanceof org.hl7.fhir.r4b.model.PlanDefinition)
219      return PlanDefinition43_50.convertPlanDefinition((org.hl7.fhir.r4b.model.PlanDefinition) src);
220    if (src instanceof org.hl7.fhir.r4b.model.Practitioner)
221      return Practitioner43_50.convertPractitioner((org.hl7.fhir.r4b.model.Practitioner) src);
222    if (src instanceof org.hl7.fhir.r4b.model.PractitionerRole)
223      return PractitionerRole43_50.convertPractitionerRole((org.hl7.fhir.r4b.model.PractitionerRole) src);
224    if (src instanceof org.hl7.fhir.r4b.model.Procedure)
225      return Procedure43_50.convertProcedure((org.hl7.fhir.r4b.model.Procedure) src);
226    if (src instanceof org.hl7.fhir.r4b.model.Provenance)
227      return Provenance43_50.convertProvenance((org.hl7.fhir.r4b.model.Provenance) src);
228    if (src instanceof org.hl7.fhir.r4b.model.Questionnaire)
229      return Questionnaire43_50.convertQuestionnaire((org.hl7.fhir.r4b.model.Questionnaire) src);
230    if (src instanceof org.hl7.fhir.r4b.model.QuestionnaireResponse)
231      return QuestionnaireResponse43_50.convertQuestionnaireResponse((org.hl7.fhir.r4b.model.QuestionnaireResponse) src);
232    if (src instanceof org.hl7.fhir.r4b.model.RelatedPerson)
233      return RelatedPerson43_50.convertRelatedPerson((org.hl7.fhir.r4b.model.RelatedPerson) src);
234    if (src instanceof org.hl7.fhir.r4b.model.RiskAssessment)
235      return RiskAssessment43_50.convertRiskAssessment((org.hl7.fhir.r4b.model.RiskAssessment) src);
236    if (src instanceof org.hl7.fhir.r4b.model.Schedule)
237      return Schedule43_50.convertSchedule((org.hl7.fhir.r4b.model.Schedule) src);
238    if (src instanceof org.hl7.fhir.r4b.model.SearchParameter)
239      return SearchParameter43_50.convertSearchParameter((org.hl7.fhir.r4b.model.SearchParameter) src);
240    if (src instanceof org.hl7.fhir.r4b.model.ServiceRequest)
241      return ServiceRequest43_50.convertServiceRequest((org.hl7.fhir.r4b.model.ServiceRequest) src);
242    if (src instanceof org.hl7.fhir.r4b.model.Slot) return Slot43_50.convertSlot((org.hl7.fhir.r4b.model.Slot) src);
243    if (src instanceof org.hl7.fhir.r4b.model.Specimen)
244      return Specimen43_50.convertSpecimen((org.hl7.fhir.r4b.model.Specimen) src);
245    if (src instanceof org.hl7.fhir.r4b.model.SpecimenDefinition)
246      return SpecimenDefinition43_50.convertSpecimenDefinition((org.hl7.fhir.r4b.model.SpecimenDefinition) src);
247    if (src instanceof org.hl7.fhir.r4b.model.StructureDefinition)
248      return StructureDefinition43_50.convertStructureDefinition((org.hl7.fhir.r4b.model.StructureDefinition) src);
249    if (src instanceof org.hl7.fhir.r4b.model.StructureMap)
250      return StructureMap43_50.convertStructureMap((org.hl7.fhir.r4b.model.StructureMap) src);
251    if (src instanceof org.hl7.fhir.r4b.model.SubscriptionStatus)
252      return SubscriptionStatus43_50.convertSubscriptionStatus((org.hl7.fhir.r4b.model.SubscriptionStatus)src);
253    if (src instanceof org.hl7.fhir.r4b.model.SubscriptionTopic)
254      return SubscriptionTopic43_50.convertSubscriptionTopic((org.hl7.fhir.r4b.model.SubscriptionTopic)src);
255    if (src instanceof org.hl7.fhir.r4b.model.Substance)
256      return Substance43_50.convertSubstance((org.hl7.fhir.r4b.model.Substance) src);
257    if (src instanceof org.hl7.fhir.r4b.model.SupplyDelivery)
258      return SupplyDelivery43_50.convertSupplyDelivery((org.hl7.fhir.r4b.model.SupplyDelivery) src);
259    if (src instanceof org.hl7.fhir.r4b.model.SupplyRequest)
260      return SupplyRequest43_50.convertSupplyRequest((org.hl7.fhir.r4b.model.SupplyRequest) src);
261    if (src instanceof org.hl7.fhir.r4b.model.Task) return Task43_50.convertTask((org.hl7.fhir.r4b.model.Task) src);
262    if (src instanceof org.hl7.fhir.r4b.model.TerminologyCapabilities)
263      return TerminologyCapabilities43_50.convertTerminologyCapabilities((org.hl7.fhir.r4b.model.TerminologyCapabilities) src);
264    if (src instanceof org.hl7.fhir.r4b.model.TestReport)
265      return TestReport43_50.convertTestReport((org.hl7.fhir.r4b.model.TestReport) src);
266    if (src instanceof org.hl7.fhir.r4b.model.TestScript)
267      return TestScript43_50.convertTestScript((org.hl7.fhir.r4b.model.TestScript) src);
268    if (src instanceof org.hl7.fhir.r4b.model.ValueSet)
269      return ValueSet43_50.convertValueSet((org.hl7.fhir.r4b.model.ValueSet) src);
270    if (src instanceof org.hl7.fhir.r4b.model.VerificationResult)
271      return VerificationResult43_50.convertVerificationResult((org.hl7.fhir.r4b.model.VerificationResult) src);
272    if (src instanceof org.hl7.fhir.r4b.model.VisionPrescription)
273      return VisionPrescription43_50.convertVisionPrescription((org.hl7.fhir.r4b.model.VisionPrescription) src);
274    if (advisor.failFastOnNullOrUnknownEntry()) {
275      throw new FHIRException("The resource " + src.fhirType()+" cannot be converted from R4B to R5");
276    } else {
277      return null;
278    }
279  }
280
281  public org.hl7.fhir.r4b.model.Resource convertResource(org.hl7.fhir.r5.model.Resource src) throws FHIRException {
282    if (src == null) return null;
283    if (src instanceof org.hl7.fhir.r5.model.Parameters)
284      return Parameters43_50.convertParameters((org.hl7.fhir.r5.model.Parameters) src);
285    if (src instanceof org.hl7.fhir.r5.model.Account)
286      return Account43_50.convertAccount((org.hl7.fhir.r5.model.Account) src);
287    if (src instanceof org.hl7.fhir.r5.model.ActivityDefinition)
288      return ActivityDefinition43_50.convertActivityDefinition((org.hl7.fhir.r5.model.ActivityDefinition) src);
289    if (src instanceof org.hl7.fhir.r5.model.ActorDefinition)
290      return ActorDefinition43_50.convertActorDefinition((org.hl7.fhir.r5.model.ActorDefinition) src);
291    if (src instanceof org.hl7.fhir.r5.model.AllergyIntolerance)
292      return AllergyIntolerance43_50.convertAllergyIntolerance((org.hl7.fhir.r5.model.AllergyIntolerance) src);
293    if (src instanceof org.hl7.fhir.r5.model.Appointment)
294      return Appointment43_50.convertAppointment((org.hl7.fhir.r5.model.Appointment) src);
295    if (src instanceof org.hl7.fhir.r5.model.AppointmentResponse)
296      return AppointmentResponse43_50.convertAppointmentResponse((org.hl7.fhir.r5.model.AppointmentResponse) src);
297    if (src instanceof org.hl7.fhir.r5.model.AuditEvent)
298      return AuditEvent43_50.convertAuditEvent((org.hl7.fhir.r5.model.AuditEvent) src);
299    if (src instanceof org.hl7.fhir.r5.model.Basic) return Basic43_50.convertBasic((org.hl7.fhir.r5.model.Basic) src);
300    if (src instanceof org.hl7.fhir.r5.model.Binary)
301      return Binary43_50.convertBinary((org.hl7.fhir.r5.model.Binary) src);
302    if (src instanceof org.hl7.fhir.r5.model.BiologicallyDerivedProduct)
303      return BiologicallyDerivedProduct43_50.convertBiologicallyDerivedProduct((org.hl7.fhir.r5.model.BiologicallyDerivedProduct) src);
304    if (src instanceof org.hl7.fhir.r5.model.BodyStructure)
305      return BodyStructure43_50.convertBodyStructure((org.hl7.fhir.r5.model.BodyStructure) src);
306    if (src instanceof org.hl7.fhir.r5.model.Bundle)
307      return Bundle43_50.convertBundle((org.hl7.fhir.r5.model.Bundle) src);
308    if (src instanceof org.hl7.fhir.r5.model.CapabilityStatement)
309      return CapabilityStatement43_50.convertCapabilityStatement((org.hl7.fhir.r5.model.CapabilityStatement) src);
310    if (src instanceof org.hl7.fhir.r5.model.CarePlan)
311      return CarePlan43_50.convertCarePlan((org.hl7.fhir.r5.model.CarePlan) src);
312    if (src instanceof org.hl7.fhir.r5.model.CareTeam)
313      return CareTeam43_50.convertCareTeam((org.hl7.fhir.r5.model.CareTeam) src);
314    if (src instanceof org.hl7.fhir.r5.model.ChargeItem)
315      return ChargeItem43_50.convertChargeItem((org.hl7.fhir.r5.model.ChargeItem) src);
316    if (src instanceof org.hl7.fhir.r5.model.ChargeItemDefinition)
317      return ChargeItemDefinition43_50.convertChargeItemDefinition((org.hl7.fhir.r5.model.ChargeItemDefinition) src);
318    if (src instanceof org.hl7.fhir.r5.model.Claim) return Claim43_50.convertClaim((org.hl7.fhir.r5.model.Claim) src);
319    if (src instanceof org.hl7.fhir.r5.model.ClaimResponse)
320      return ClaimResponse43_50.convertClaimResponse((org.hl7.fhir.r5.model.ClaimResponse) src);
321    if (src instanceof org.hl7.fhir.r5.model.ClinicalImpression)
322      return ClinicalImpression43_50.convertClinicalImpression((org.hl7.fhir.r5.model.ClinicalImpression) src);
323    if (src instanceof org.hl7.fhir.r5.model.CodeSystem)
324      return CodeSystem43_50.convertCodeSystem((org.hl7.fhir.r5.model.CodeSystem) src);
325    if (src instanceof org.hl7.fhir.r5.model.Communication)
326      return Communication43_50.convertCommunication((org.hl7.fhir.r5.model.Communication) src);
327    if (src instanceof org.hl7.fhir.r5.model.CommunicationRequest)
328      return CommunicationRequest43_50.convertCommunicationRequest((org.hl7.fhir.r5.model.CommunicationRequest) src);
329    if (src instanceof org.hl7.fhir.r5.model.CompartmentDefinition)
330      return CompartmentDefinition43_50.convertCompartmentDefinition((org.hl7.fhir.r5.model.CompartmentDefinition) src);
331    if (src instanceof org.hl7.fhir.r5.model.Composition)
332      return Composition43_50.convertComposition((org.hl7.fhir.r5.model.Composition) src);
333    if (src instanceof org.hl7.fhir.r5.model.ConceptMap)
334      return ConceptMap43_50.convertConceptMap((org.hl7.fhir.r5.model.ConceptMap) src);
335    if (src instanceof org.hl7.fhir.r5.model.Condition)
336      return Condition43_50.convertCondition((org.hl7.fhir.r5.model.Condition) src);
337    if (src instanceof org.hl7.fhir.r5.model.Consent)
338      return Consent43_50.convertConsent((org.hl7.fhir.r5.model.Consent) src);
339    if (src instanceof org.hl7.fhir.r5.model.Contract)
340      return Contract43_50.convertContract((org.hl7.fhir.r5.model.Contract) src);
341    if (src instanceof org.hl7.fhir.r5.model.Coverage)
342      return Coverage43_50.convertCoverage((org.hl7.fhir.r5.model.Coverage) src);
343    if (src instanceof org.hl7.fhir.r5.model.CoverageEligibilityRequest)
344      return CoverageEligibilityRequest43_50.convertCoverageEligibilityRequest((org.hl7.fhir.r5.model.CoverageEligibilityRequest) src);
345    if (src instanceof org.hl7.fhir.r5.model.DetectedIssue)
346      return DetectedIssue43_50.convertDetectedIssue((org.hl7.fhir.r5.model.DetectedIssue) src);
347    if (src instanceof org.hl7.fhir.r5.model.Device)
348      return Device43_50.convertDevice((org.hl7.fhir.r5.model.Device) src);
349    if (src instanceof org.hl7.fhir.r5.model.DeviceDefinition)
350      return DeviceDefinition43_50.convertDeviceDefinition((org.hl7.fhir.r5.model.DeviceDefinition) src);
351    if (src instanceof org.hl7.fhir.r5.model.DeviceMetric)
352      return DeviceMetric43_50.convertDeviceMetric((org.hl7.fhir.r5.model.DeviceMetric) src);
353    if (src instanceof org.hl7.fhir.r5.model.DeviceRequest)
354      return DeviceRequest43_50.convertDeviceRequest((org.hl7.fhir.r5.model.DeviceRequest) src);
355    if (src instanceof org.hl7.fhir.r5.model.DeviceUsage)
356      return DeviceUseStatement43_50.convertDeviceUseStatement((org.hl7.fhir.r5.model.DeviceUsage) src);
357    if (src instanceof org.hl7.fhir.r5.model.DiagnosticReport)
358      return DiagnosticReport43_50.convertDiagnosticReport((org.hl7.fhir.r5.model.DiagnosticReport) src);
359//    if (src instanceof org.hl7.fhir.r5.model.DocumentManifest)
360//      return DocumentManifest43_50.convertDocumentManifest((org.hl7.fhir.r5.model.DocumentManifest) src);
361    if (src instanceof org.hl7.fhir.r5.model.DocumentReference)
362      return DocumentReference43_50.convertDocumentReference((org.hl7.fhir.r5.model.DocumentReference) src);
363    if (src instanceof org.hl7.fhir.r5.model.Encounter)
364      return Encounter43_50.convertEncounter((org.hl7.fhir.r5.model.Encounter) src);
365    if (src instanceof org.hl7.fhir.r5.model.Endpoint)
366      return Endpoint43_50.convertEndpoint((org.hl7.fhir.r5.model.Endpoint) src);
367    if (src instanceof org.hl7.fhir.r5.model.EnrollmentRequest)
368      return EnrollmentRequest43_50.convertEnrollmentRequest((org.hl7.fhir.r5.model.EnrollmentRequest) src);
369    if (src instanceof org.hl7.fhir.r5.model.EpisodeOfCare)
370      return EpisodeOfCare43_50.convertEpisodeOfCare((org.hl7.fhir.r5.model.EpisodeOfCare) src);
371    if (src instanceof org.hl7.fhir.r5.model.EventDefinition)
372      return EventDefinition43_50.convertEventDefinition((org.hl7.fhir.r5.model.EventDefinition) src);
373    if (src instanceof org.hl7.fhir.r5.model.ExampleScenario)
374      return ExampleScenario43_50.convertExampleScenario((org.hl7.fhir.r5.model.ExampleScenario) src);
375    if (src instanceof org.hl7.fhir.r5.model.ExplanationOfBenefit)
376      return ExplanationOfBenefit43_50.convertExplanationOfBenefit((org.hl7.fhir.r5.model.ExplanationOfBenefit) src);
377    if (src instanceof org.hl7.fhir.r5.model.FamilyMemberHistory)
378      return FamilyMemberHistory43_50.convertFamilyMemberHistory((org.hl7.fhir.r5.model.FamilyMemberHistory) src);
379    if (src instanceof org.hl7.fhir.r5.model.Flag) return Flag43_50.convertFlag((org.hl7.fhir.r5.model.Flag) src);
380    if (src instanceof org.hl7.fhir.r5.model.Goal) return Goal43_50.convertGoal((org.hl7.fhir.r5.model.Goal) src);
381    if (src instanceof org.hl7.fhir.r5.model.GraphDefinition)
382      return GraphDefinition43_50.convertGraphDefinition((org.hl7.fhir.r5.model.GraphDefinition) src);
383    if (src instanceof org.hl7.fhir.r5.model.Group) return Group43_50.convertGroup((org.hl7.fhir.r5.model.Group) src);
384    if (src instanceof org.hl7.fhir.r5.model.GuidanceResponse)
385      return GuidanceResponse43_50.convertGuidanceResponse((org.hl7.fhir.r5.model.GuidanceResponse) src);
386    if (src instanceof org.hl7.fhir.r5.model.HealthcareService)
387      return HealthcareService43_50.convertHealthcareService((org.hl7.fhir.r5.model.HealthcareService) src);
388    if (src instanceof org.hl7.fhir.r5.model.ImagingStudy)
389      return ImagingStudy43_50.convertImagingStudy((org.hl7.fhir.r5.model.ImagingStudy) src);
390    if (src instanceof org.hl7.fhir.r5.model.Immunization)
391      return Immunization43_50.convertImmunization((org.hl7.fhir.r5.model.Immunization) src);
392    if (src instanceof org.hl7.fhir.r5.model.ImmunizationEvaluation)
393      return ImmunizationEvaluation43_50.convertImmunizationEvaluation((org.hl7.fhir.r5.model.ImmunizationEvaluation) src);
394    if (src instanceof org.hl7.fhir.r5.model.ImmunizationRecommendation)
395      return ImmunizationRecommendation43_50.convertImmunizationRecommendation((org.hl7.fhir.r5.model.ImmunizationRecommendation) src);
396    if (src instanceof org.hl7.fhir.r5.model.ImplementationGuide)
397      return ImplementationGuide43_50.convertImplementationGuide((org.hl7.fhir.r5.model.ImplementationGuide) src);
398    if (src instanceof org.hl7.fhir.r5.model.InsurancePlan)
399      return InsurancePlan43_50.convertInsurancePlan((org.hl7.fhir.r5.model.InsurancePlan) src);
400    if (src instanceof org.hl7.fhir.r5.model.Invoice)
401      return Invoice43_50.convertInvoice((org.hl7.fhir.r5.model.Invoice) src);
402    if (src instanceof org.hl7.fhir.r5.model.Library)
403      return Library43_50.convertLibrary((org.hl7.fhir.r5.model.Library) src);
404    if (src instanceof org.hl7.fhir.r5.model.Linkage)
405      return Linkage43_50.convertLinkage((org.hl7.fhir.r5.model.Linkage) src);
406    if (src instanceof org.hl7.fhir.r5.model.ListResource)
407      return ListResource43_50.convertListResource((org.hl7.fhir.r5.model.ListResource) src);
408    if (src instanceof org.hl7.fhir.r5.model.Location)
409      return Location43_50.convertLocation((org.hl7.fhir.r5.model.Location) src);
410    if (src instanceof org.hl7.fhir.r5.model.Measure)
411      return Measure43_50.convertMeasure((org.hl7.fhir.r5.model.Measure) src);
412    if (src instanceof org.hl7.fhir.r5.model.MeasureReport)
413      return MeasureReport43_50.convertMeasureReport((org.hl7.fhir.r5.model.MeasureReport) src);
414    if (src instanceof org.hl7.fhir.r5.model.DocumentReference)
415      return Media43_50.convertMedia((org.hl7.fhir.r5.model.DocumentReference) src);
416    if (src instanceof org.hl7.fhir.r5.model.Medication)
417      return Medication43_50.convertMedication((org.hl7.fhir.r5.model.Medication) src);
418    if (src instanceof org.hl7.fhir.r5.model.MedicationAdministration)
419      return MedicationAdministration43_50.convertMedicationAdministration((org.hl7.fhir.r5.model.MedicationAdministration) src);
420    if (src instanceof org.hl7.fhir.r5.model.MedicationDispense)
421      return MedicationDispense43_50.convertMedicationDispense((org.hl7.fhir.r5.model.MedicationDispense) src);
422    if (src instanceof org.hl7.fhir.r5.model.MedicationKnowledge)
423      return MedicationKnowledge43_50.convertMedicationKnowledge((org.hl7.fhir.r5.model.MedicationKnowledge) src);
424    if (src instanceof org.hl7.fhir.r5.model.MedicationRequest)
425      return MedicationRequest43_50.convertMedicationRequest((org.hl7.fhir.r5.model.MedicationRequest) src);
426    if (src instanceof org.hl7.fhir.r5.model.MedicationStatement)
427      return MedicationStatement43_50.convertMedicationStatement((org.hl7.fhir.r5.model.MedicationStatement) src);
428    if (src instanceof org.hl7.fhir.r5.model.MessageDefinition)
429      return MessageDefinition43_50.convertMessageDefinition((org.hl7.fhir.r5.model.MessageDefinition) src);
430    if (src instanceof org.hl7.fhir.r5.model.MessageHeader)
431      return MessageHeader43_50.convertMessageHeader((org.hl7.fhir.r5.model.MessageHeader) src);
432    if (src instanceof org.hl7.fhir.r5.model.NamingSystem)
433      return NamingSystem43_50.convertNamingSystem((org.hl7.fhir.r5.model.NamingSystem) src);
434    if (src instanceof org.hl7.fhir.r5.model.NutritionOrder)
435      return NutritionOrder43_50.convertNutritionOrder((org.hl7.fhir.r5.model.NutritionOrder) src);
436    if (src instanceof org.hl7.fhir.r5.model.Observation)
437      return Observation43_50.convertObservation((org.hl7.fhir.r5.model.Observation) src);
438    if (src instanceof org.hl7.fhir.r5.model.ObservationDefinition)
439      return ObservationDefinition43_50.convertObservationDefinition((org.hl7.fhir.r5.model.ObservationDefinition) src);
440    if (src instanceof org.hl7.fhir.r5.model.OperationDefinition)
441      return OperationDefinition43_50.convertOperationDefinition((org.hl7.fhir.r5.model.OperationDefinition) src);
442    if (src instanceof org.hl7.fhir.r5.model.OperationOutcome)
443      return OperationOutcome43_50.convertOperationOutcome((org.hl7.fhir.r5.model.OperationOutcome) src);
444    if (src instanceof org.hl7.fhir.r5.model.Organization)
445      return Organization43_50.convertOrganization((org.hl7.fhir.r5.model.Organization) src);
446    if (src instanceof org.hl7.fhir.r5.model.OrganizationAffiliation)
447      return OrganizationAffiliation43_50.convertOrganizationAffiliation((org.hl7.fhir.r5.model.OrganizationAffiliation) src);
448    if (src instanceof org.hl7.fhir.r5.model.Patient)
449      return Patient43_50.convertPatient((org.hl7.fhir.r5.model.Patient) src);
450    if (src instanceof org.hl7.fhir.r5.model.PaymentNotice)
451      return PaymentNotice43_50.convertPaymentNotice((org.hl7.fhir.r5.model.PaymentNotice) src);
452    if (src instanceof org.hl7.fhir.r5.model.Person)
453      return Person43_50.convertPerson((org.hl7.fhir.r5.model.Person) src);
454    if (src instanceof org.hl7.fhir.r5.model.PlanDefinition)
455      return PlanDefinition43_50.convertPlanDefinition((org.hl7.fhir.r5.model.PlanDefinition) src);
456    if (src instanceof org.hl7.fhir.r5.model.Practitioner)
457      return Practitioner43_50.convertPractitioner((org.hl7.fhir.r5.model.Practitioner) src);
458    if (src instanceof org.hl7.fhir.r5.model.PractitionerRole)
459      return PractitionerRole43_50.convertPractitionerRole((org.hl7.fhir.r5.model.PractitionerRole) src);
460    if (src instanceof org.hl7.fhir.r5.model.Procedure)
461      return Procedure43_50.convertProcedure((org.hl7.fhir.r5.model.Procedure) src);
462    if (src instanceof org.hl7.fhir.r5.model.Provenance)
463      return Provenance43_50.convertProvenance((org.hl7.fhir.r5.model.Provenance) src);
464    if (src instanceof org.hl7.fhir.r5.model.Questionnaire)
465      return Questionnaire43_50.convertQuestionnaire((org.hl7.fhir.r5.model.Questionnaire) src);
466    if (src instanceof org.hl7.fhir.r5.model.QuestionnaireResponse)
467      return QuestionnaireResponse43_50.convertQuestionnaireResponse((org.hl7.fhir.r5.model.QuestionnaireResponse) src);
468    if (src instanceof org.hl7.fhir.r5.model.RelatedPerson)
469      return RelatedPerson43_50.convertRelatedPerson((org.hl7.fhir.r5.model.RelatedPerson) src);
470    if (src instanceof org.hl7.fhir.r5.model.Requirements)
471      return Requirements43_50.convertRequirements((org.hl7.fhir.r5.model.Requirements) src);
472    if (src instanceof org.hl7.fhir.r5.model.RiskAssessment)
473      return RiskAssessment43_50.convertRiskAssessment((org.hl7.fhir.r5.model.RiskAssessment) src);
474    if (src instanceof org.hl7.fhir.r5.model.Schedule)
475      return Schedule43_50.convertSchedule((org.hl7.fhir.r5.model.Schedule) src);
476    if (src instanceof org.hl7.fhir.r5.model.SearchParameter)
477      return SearchParameter43_50.convertSearchParameter((org.hl7.fhir.r5.model.SearchParameter) src);
478    if (src instanceof org.hl7.fhir.r5.model.ServiceRequest)
479      return ServiceRequest43_50.convertServiceRequest((org.hl7.fhir.r5.model.ServiceRequest) src);
480    if (src instanceof org.hl7.fhir.r5.model.Slot) return Slot43_50.convertSlot((org.hl7.fhir.r5.model.Slot) src);
481    if (src instanceof org.hl7.fhir.r5.model.Specimen)
482      return Specimen43_50.convertSpecimen((org.hl7.fhir.r5.model.Specimen) src);
483    if (src instanceof org.hl7.fhir.r5.model.SpecimenDefinition)
484      return SpecimenDefinition43_50.convertSpecimenDefinition((org.hl7.fhir.r5.model.SpecimenDefinition) src);
485    if (src instanceof org.hl7.fhir.r5.model.StructureDefinition)
486      return StructureDefinition43_50.convertStructureDefinition((org.hl7.fhir.r5.model.StructureDefinition) src);
487    if (src instanceof org.hl7.fhir.r5.model.StructureMap)
488      return StructureMap43_50.convertStructureMap((org.hl7.fhir.r5.model.StructureMap) src);
489    if (src instanceof org.hl7.fhir.r5.model.SubscriptionStatus)
490      return SubscriptionStatus43_50.convertSubscriptionStatus((org.hl7.fhir.r5.model.SubscriptionStatus)src);
491    if (src instanceof org.hl7.fhir.r5.model.SubscriptionTopic)
492      return SubscriptionTopic43_50.convertSubscriptionTopic((org.hl7.fhir.r5.model.SubscriptionTopic)src);
493    if (src instanceof org.hl7.fhir.r5.model.Substance)
494      return Substance43_50.convertSubstance((org.hl7.fhir.r5.model.Substance) src);
495    if (src instanceof org.hl7.fhir.r5.model.SupplyDelivery)
496      return SupplyDelivery43_50.convertSupplyDelivery((org.hl7.fhir.r5.model.SupplyDelivery) src);
497    if (src instanceof org.hl7.fhir.r5.model.SupplyRequest)
498      return SupplyRequest43_50.convertSupplyRequest((org.hl7.fhir.r5.model.SupplyRequest) src);
499    if (src instanceof org.hl7.fhir.r5.model.Task) return Task43_50.convertTask((org.hl7.fhir.r5.model.Task) src);
500    if (src instanceof org.hl7.fhir.r5.model.TerminologyCapabilities)
501      return TerminologyCapabilities43_50.convertTerminologyCapabilities((org.hl7.fhir.r5.model.TerminologyCapabilities) src);
502    if (src instanceof org.hl7.fhir.r5.model.TestPlan)
503      return TestPlan43_50.convertTestPlan((org.hl7.fhir.r5.model.TestPlan)src);
504    if (src instanceof org.hl7.fhir.r5.model.TestReport)
505      return TestReport43_50.convertTestReport((org.hl7.fhir.r5.model.TestReport) src);
506    if (src instanceof org.hl7.fhir.r5.model.TestScript)
507      return TestScript43_50.convertTestScript((org.hl7.fhir.r5.model.TestScript) src);
508    if (src instanceof org.hl7.fhir.r5.model.ValueSet)
509      return ValueSet43_50.convertValueSet((org.hl7.fhir.r5.model.ValueSet) src);
510    if (src instanceof org.hl7.fhir.r5.model.VerificationResult)
511      return VerificationResult43_50.convertVerificationResult((org.hl7.fhir.r5.model.VerificationResult) src);
512    if (src instanceof org.hl7.fhir.r5.model.VisionPrescription)
513      return VisionPrescription43_50.convertVisionPrescription((org.hl7.fhir.r5.model.VisionPrescription) src);
514    if (advisor.failFastOnNullOrUnknownEntry()) {
515      throw new FHIRException("The resource " + src.fhirType()+" cannot be converted from R5 to R4B");
516    } else {
517      return null;
518    }
519  }
520
521  public void copyDomainResource(org.hl7.fhir.r4b.model.DomainResource src, org.hl7.fhir.r5.model.DomainResource tgt, String ... extensionUrlsToIgnore) throws FHIRException {
522    copyResource(src, tgt);
523    if (src.hasText()) tgt.setText(Narrative43_50.convertNarrative(src.getText()));
524    src.getContained().stream()
525      .map(this::convertResource)
526      .forEach(tgt::addContained);
527    src.getExtension().forEach(extension -> {
528      if (advisor.useAdvisorForExtension(ConversionContext43_50.INSTANCE.path(), extension)) {
529        org.hl7.fhir.r5.model.Extension convertExtension = new org.hl7.fhir.r5.model.Extension();
530        advisor.handleExtension(ConversionContext43_50.INSTANCE.path(), extension, convertExtension);
531        tgt.addExtension(convertExtension);
532      } else if (!advisor.ignoreExtension(ConversionContext43_50.INSTANCE.path(), extension) && !Arrays.asList(extensionUrlsToIgnore).contains(extension.getUrl())) {
533        tgt.addExtension(Extension43_50.convertExtension(extension));
534      }
535    });
536    src.getModifierExtension().stream()
537      .filter(extension -> !advisor.ignoreExtension(ConversionContext43_50.INSTANCE.path(), extension))
538      .map(Extension43_50::convertExtension)
539      .forEach(tgt::addModifierExtension);
540  }
541
542  public void copyDomainResource(org.hl7.fhir.r5.model.DomainResource src, org.hl7.fhir.r4b.model.DomainResource tgt, String ... extensionUrlsToIgnore) throws FHIRException {
543    copyResource(src, tgt);
544    if (src.hasText()) tgt.setText(Narrative43_50.convertNarrative(src.getText()));
545    src.getContained().stream()
546      .map(this::convertResource)
547      .forEach(tgt::addContained);
548    src.getExtension().forEach(extension -> {
549      if (advisor.useAdvisorForExtension(ConversionContext43_50.INSTANCE.path(), extension)) {
550        org.hl7.fhir.r4b.model.Extension convertExtension = new org.hl7.fhir.r4b.model.Extension();
551        advisor.handleExtension(ConversionContext43_50.INSTANCE.path(), extension, convertExtension);
552        tgt.addExtension(convertExtension);
553      } else if (!advisor.ignoreExtension(ConversionContext43_50.INSTANCE.path(), extension) && !Arrays.asList(extensionUrlsToIgnore).contains(extension.getUrl())) {
554        tgt.addExtension(Extension43_50.convertExtension(extension));
555      }
556    });
557    src.getModifierExtension().stream()
558      .filter(extension -> !advisor.ignoreExtension(ConversionContext43_50.INSTANCE.path(), extension))
559      .map(Extension43_50::convertExtension)
560      .forEach(tgt::addModifierExtension);
561  }
562}